diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-01-25 22:29:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 22:29:56 +0000 |
commit | b400219df5f245ef2eb3c7ce0589b1f8020a1192 (patch) | |
tree | 6ce0e7cf8c039cf5c5f2f573c7f6060c329cdc35 /Python/bytecodes.c | |
parent | 6162a0e305faf82534c011ddb2fb99a94ae84d29 (diff) | |
download | cpython-git-b400219df5f245ef2eb3c7ce0589b1f8020a1192.tar.gz |
gh-98831: rewrite RAISE_VARARGS in the instruction definition DSL (#101306)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index d3e242b81e..e5769f61fc 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -505,27 +505,24 @@ dummy_func( ERROR_IF(res == NULL, error); } - // This should remain a legacy instruction. - inst(RAISE_VARARGS) { + inst(RAISE_VARARGS, (args[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; - } + ERROR_IF(do_raise(tstate, exc, cause), exception_unwind); break; default: _PyErr_SetString(tstate, PyExc_SystemError, "bad RAISE_VARARGS oparg"); break; } - goto error; + ERROR_IF(true, error); } inst(INTERPRETER_EXIT, (retval --)) { |