[Python-checkins] cpython: Remove redundant check for tb != NULL to shut up Coverity . It has been set to

christian.heimes python-checkins at python.org
Thu Apr 16 17:26:38 CEST 2015


https://hg.python.org/cpython/rev/075f8aab52b3
changeset: 95691:075f8aab52b3
user: Christian Heimes <christian at python.org>
date: Thu Apr 16 17:25:45 2015 +0200
summary:
 Remove redundant check for tb != NULL to shut up Coverity . It has been set to Py_None a couple of lines earlier.
CID 1291697 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking tb suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
files:
 Python/pylifecycle.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1283,7 +1283,7 @@
 goto display_stack;
 }
 
- has_tb = (tb != NULL && tb != Py_None);
+ has_tb = (tb != Py_None);
 PyErr_Display(exception, v, tb);
 Py_XDECREF(exception);
 Py_XDECREF(v);
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /