From c019158a4c7a7b79a7d2d4f1de87c8789a5ec13d Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 27 Sep 2016 11:37:10 +0300 Subject: [PATCH] Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode. Patch by Xiang Zhang. --- Python/ceval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index 39cf33019d..a09de05ebe 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: -- 2.49.0