Issue #20440: More use of Py_SETREF.

This patch is manually crafted and contains changes that couldn't be handled
automatically.
This commit is contained in:
Serhiy Storchaka 2015-12-27 15:41:34 +02:00
parent 4a1e70fc31
commit 191321d11b
7 changed files with 39 additions and 58 deletions

View file

@ -315,14 +315,11 @@ finally:
tstate = PyThreadState_GET();
if (++tstate->recursion_depth > Py_GetRecursionLimit()) {
--tstate->recursion_depth;
/* throw away the old exception... */
Py_DECREF(*exc);
Py_DECREF(*val);
/* ... and use the recursion error instead */
*exc = PyExc_RecursionError;
*val = PyExc_RecursionErrorInst;
Py_INCREF(*exc);
Py_INCREF(*val);
/* throw away the old exception and use the recursion error instead */
Py_INCREF(PyExc_RecursionError);
Py_SETREF(*exc, PyExc_RecursionError);
Py_INCREF(PyExc_RecursionErrorInst);
Py_SETREF(*val, PyExc_RecursionErrorInst);
/* just keeping the old traceback */
return;
}