mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)
This commit is contained in:
parent
6162a0e305
commit
b400219df5
4 changed files with 20 additions and 18 deletions
11
Python/generated_cases.c.h
generated
11
Python/generated_cases.c.h
generated
|
|
@ -689,25 +689,24 @@
|
|||
}
|
||||
|
||||
TARGET(RAISE_VARARGS) {
|
||||
PyObject **args = &PEEK(oparg);
|
||||
PyObject *cause = NULL, *exc = NULL;
|
||||
switch (oparg) {
|
||||
case 2:
|
||||
cause = POP(); /* cause */
|
||||
cause = args[1];
|
||||
/* fall through */
|
||||
case 1:
|
||||
exc = POP(); /* exc */
|
||||
exc = args[0];
|
||||
/* fall through */
|
||||
case 0:
|
||||
if (do_raise(tstate, exc, cause)) {
|
||||
goto exception_unwind;
|
||||
}
|
||||
if (do_raise(tstate, exc, cause)) { STACK_SHRINK(oparg); goto exception_unwind; }
|
||||
break;
|
||||
default:
|
||||
_PyErr_SetString(tstate, PyExc_SystemError,
|
||||
"bad RAISE_VARARGS oparg");
|
||||
break;
|
||||
}
|
||||
goto error;
|
||||
if (true) { STACK_SHRINK(oparg); goto error; }
|
||||
}
|
||||
|
||||
TARGET(INTERPRETER_EXIT) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue