diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 15:44:33 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-27 15:44:33 +0200 |
commit | 726fc139a5f40d81a0013c856be1283da08de4a0 (patch) | |
tree | 7a7fe3b19e13842df5b5d45a8567fbfb5e7bbd75 /Python/errors.c | |
parent | bdb908ea5466bfa09869fd2e1e7f3b17fe0fb2ea (diff) | |
parent | 191321d11bc7e064e1a07830a43fa600de310e1b (diff) | |
download | cpython-git-726fc139a5f40d81a0013c856be1283da08de4a0.tar.gz |
Issue #20440: More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled
automatically.
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Python/errors.c b/Python/errors.c index aed2bdc12d..7b67566727 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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; } |