diff options
author | Mark Shannon <mark@hotpy.org> | 2020-01-13 12:51:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 12:51:26 (GMT) |
commit | e7c9f4aae1a8540fe8e9a8a5017b16f906f51068 (patch) | |
tree | 30ad0ede1cb263c0882121a14c25f4e98b40bfe9 /Python | |
parent | 97f1267a5431db97bd6f88f996a35ea516581100 (diff) | |
download | cpython-e7c9f4aae1a8540fe8e9a8a5017b16f906f51068.zip cpython-e7c9f4aae1a8540fe8e9a8a5017b16f906f51068.tar.gz cpython-e7c9f4aae1a8540fe8e9a8a5017b16f906f51068.tar.bz2 |
Cleanup exit code for interpreter. (GH-17756)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 3bbd0ca..f780c21 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1913,7 +1913,8 @@ main_loop: case TARGET(RETURN_VALUE): { retval = POP(); assert(f->f_iblock == 0); - goto exit_returning; + assert(EMPTY()); + goto exiting; } case TARGET(GET_AITER): { @@ -2083,7 +2084,7 @@ main_loop: /* and repeat... */ assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT)); f->f_lasti -= sizeof(_Py_CODEUNIT); - goto exit_yielding; + goto exiting; } case TARGET(YIELD_VALUE): { @@ -2100,7 +2101,7 @@ main_loop: } f->f_stacktop = stack_pointer; - goto exit_yielding; + goto exiting; } case TARGET(POP_EXCEPT): { @@ -3632,15 +3633,13 @@ exception_unwind: assert(retval == NULL); assert(_PyErr_Occurred(tstate)); -exit_returning: - /* Pop remaining stack entries. */ while (!EMPTY()) { PyObject *o = POP(); Py_XDECREF(o); } -exit_yielding: +exiting: if (tstate->use_tracing) { if (tstate->c_tracefunc) { if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, |