From f04ce13b5076d85eeb6bd6ca15af239db46ea7b3 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Tue, 15 Aug 2023 15:27:39 +0100 Subject: [PATCH] gh-103082: remove assumption that INSTRUMENTED_LINE is the last instrumented opcode --- Python/instrumentation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/instrumentation.c b/Python/instrumentation.c index b50e8e26476cd4..48befed4ea838c 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -121,7 +121,7 @@ static inline bool opcode_has_event(int opcode) { return ( - opcode < INSTRUMENTED_LINE && + opcode != INSTRUMENTED_LINE && INSTRUMENTED_OPCODES[opcode] > 0 ); } @@ -1202,7 +1202,7 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame, Py_DECREF(line_obj); done: assert(original_opcode != 0); - assert(original_opcode < INSTRUMENTED_LINE); + assert(original_opcode != INSTRUMENTED_LINE); assert(_PyOpcode_Deopt[original_opcode] == original_opcode); return original_opcode; }