From 47c304ed88fac03160b77d6c1b1807af4eba03a3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 30 Apr 2025 08:14:47 +0800 Subject: [PATCH 1/2] Remove two unused error branches. --- Python/bytecodes.c | 12 ------------ Python/generated_cases.c.h | 14 -------------- 2 files changed, 26 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 7ae687f1bfaad3..a94b8f03ef8e32 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5296,18 +5296,6 @@ dummy_func( assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); } - label(pop_4_error) { - stack_pointer -= 4; - assert(WITHIN_STACK_BOUNDS()); - goto error; - } - - label(pop_3_error) { - stack_pointer -= 3; - assert(WITHIN_STACK_BOUNDS()); - goto error; - } - label(pop_2_error) { stack_pointer -= 2; assert(WITHIN_STACK_BOUNDS()); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 88ab86a774f0ff..24971af5cc3791 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -12134,20 +12134,6 @@ JUMP_TO_LABEL(error); #endif /* Py_TAIL_CALL_INTERP */ /* BEGIN LABELS */ - LABEL(pop_4_error) - { - stack_pointer -= 4; - assert(WITHIN_STACK_BOUNDS()); - JUMP_TO_LABEL(error); - } - - LABEL(pop_3_error) - { - stack_pointer -= 3; - assert(WITHIN_STACK_BOUNDS()); - JUMP_TO_LABEL(error); - } - LABEL(pop_2_error) { stack_pointer -= 2; From 8bc10967fc1ed7b40d91ff606f23872f7aa02e76 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 30 Apr 2025 08:34:40 +0800 Subject: [PATCH 2/2] Add another generated file. --- Python/opcode_targets.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h index 5b9fb794c6bddc..2346780ccaaf0d 100644 --- a/Python/opcode_targets.h +++ b/Python/opcode_targets.h @@ -260,8 +260,6 @@ static void *opcode_targets[256] = { #else /* Py_TAIL_CALL_INTERP */ static py_tail_call_funcptr INSTRUCTION_TABLE[256]; -Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_4_error(TAIL_CALL_PARAMS); -Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_3_error(TAIL_CALL_PARAMS); Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_2_error(TAIL_CALL_PARAMS); Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_pop_1_error(TAIL_CALL_PARAMS); Py_PRESERVE_NONE_CC static PyObject *_TAIL_CALL_error(TAIL_CALL_PARAMS);