[Python-checkins] cpython: Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode.

serhiy.storchaka python-checkins at python.org
Tue Sep 27 04:38:20 EDT 2016


https://hg.python.org/cpython/rev/9e59cb403efa
changeset: 104098:9e59cb403efa
parent: 104096:f496fb6bf4a0
user: Serhiy Storchaka <storchaka at gmail.com>
date: Tue Sep 27 11:37:10 2016 +0300
summary:
 Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode.
Patch by Xiang Zhang.
files:
 Python/ceval.c | 7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4245,6 +4245,9 @@
 goto raise_error;
 }
 
+ assert(type != NULL);
+ assert(value != NULL);
+
 if (cause) {
 PyObject *fixed_cause;
 if (PyExceptionClass_Check(cause)) {
@@ -4271,8 +4274,8 @@
 
 PyErr_SetObject(type, value);
 /* PyErr_SetObject incref's its arguments */
- Py_XDECREF(value);
- Py_XDECREF(type);
+ Py_DECREF(value);
+ Py_DECREF(type);
 return 0;
 
 raise_error:
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

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