diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 08:37:10 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 08:37:10 (GMT) |
commit | c019158a4c7a7b79a7d2d4f1de87c8789a5ec13d (patch) | |
tree | 1a89d8a67e4b22d4d51e0ec27b782f56c634a216 /Python | |
parent | 2f63faefdf1a6af9666da0b5d7d2725463c679e7 (diff) | |
download | cpython-c019158a4c7a7b79a7d2d4f1de87c8789a5ec13d.zip cpython-c019158a4c7a7b79a7d2d4f1de87c8789a5ec13d.tar.gz cpython-c019158a4c7a7b79a7d2d4f1de87c8789a5ec13d.tar.bz2 |
Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode.
Patch by Xiang Zhang.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 39cf330..a09de05 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4245,6 +4245,9 @@ do_raise(PyObject *exc, PyObject *cause) goto raise_error; } + assert(type != NULL); + assert(value != NULL); + if (cause) { PyObject *fixed_cause; if (PyExceptionClass_Check(cause)) { @@ -4271,8 +4274,8 @@ do_raise(PyObject *exc, PyObject *cause) 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: |