diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-15 23:02:12 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-15 23:02:12 (GMT) |
commit | f243ee4055c8ed334e048e494814d557a02f72b3 (patch) | |
tree | 43960b9b008be11a0a3199f9a8308276eb87e940 /Python/ceval.c | |
parent | ceceaa00bab93bfd8b0035e4ad482bba74ae4f8e (diff) | |
download | cpython-f243ee4055c8ed334e048e494814d557a02f72b3.zip cpython-f243ee4055c8ed334e048e494814d557a02f72b3.tar.gz cpython-f243ee4055c8ed334e048e494814d557a02f72b3.tar.bz2 |
Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs
earlier
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 5a35524..2d84c09 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4216,6 +4216,8 @@ call_function(PyObject ***pp_stack, int oparg READ_TIMESTAMP(*pintr1); Py_DECREF(func); } + assert((x != NULL && !PyErr_Occurred()) + || (x == NULL && PyErr_Occurred())); /* Clear the stack of the function object. Also removes the arguments in case they weren't consumed already @@ -4509,6 +4511,8 @@ ext_call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); Py_XDECREF(stararg); + assert((result != NULL && !PyErr_Occurred()) + || (result == NULL && PyErr_Occurred())); return result; } |