]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-103082: remove assumption that INSTRUMENTED_LINE is the last instrumented opcode...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Tue, 15 Aug 2023 15:40:05 +0000 (16:40 +0100)
committerGitHub <noreply@github.com>
Tue, 15 Aug 2023 15:40:05 +0000 (16:40 +0100)
Python/instrumentation.c

index b50e8e26476cd43c65372295daca5b877c5d9d52..48befed4ea838cc1fd0b74cb6e9a47a0a98841d6 100644 (file)
@@ -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;
 }