From d7c1c6187a12f26c39963993d5c6ea0256b2666f Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Wed, 25 Jan 2023 21:03:01 +0000 Subject: [PATCH] rebase, regen, and apply Guido's suggestion --- Python/bytecodes.c | 4 +--- Python/generated_cases.c.h | 4 +--- Python/opcode_metadata.h | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index b203954efcc62c1..e5769f61fc28d0e 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -515,9 +515,7 @@ dummy_func( exc = args[0]; /* fall through */ case 0: - if (do_raise(tstate, exc, cause)) { - ERROR_IF(true, exception_unwind); - } + ERROR_IF(do_raise(tstate, exc, cause), exception_unwind); break; default: _PyErr_SetString(tstate, PyExc_SystemError, diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 76e26a4a2f8bb11..287a1f1f0420895 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -699,9 +699,7 @@ exc = args[0]; /* fall through */ case 0: - if (do_raise(tstate, exc, cause)) { - if (true) { STACK_SHRINK(oparg); goto exception_unwind; } - } + if (do_raise(tstate, exc, cause)) { STACK_SHRINK(oparg); goto exception_unwind; } break; default: _PyErr_SetString(tstate, PyExc_SystemError, diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 46fd9673e8fb644..8195fc6178857c3 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -86,7 +86,7 @@ _PyOpcode_num_popped(int opcode, int oparg) { case CALL_INTRINSIC_1: return 1; case RAISE_VARARGS: - return -1; + return oparg; case INTERPRETER_EXIT: return 1; case RETURN_VALUE: @@ -430,7 +430,7 @@ _PyOpcode_num_pushed(int opcode, int oparg) { case CALL_INTRINSIC_1: return 1; case RAISE_VARARGS: - return -1; + return 0; case INTERPRETER_EXIT: return 0; case RETURN_VALUE: