Cleanup exit code for interpreter. (GH-17756)

This commit is contained in:
Mark Shannon 2020-01-13 12:51:26 +00:00 committed by GitHub
parent 97f1267a54
commit e7c9f4aae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 42 deletions

View file

@ -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,