https://github.com/python/cpython/commit/16a305f15242ed2acac9bfdbb834804a00f6d9c5
commit: 16a305f15242ed2acac9bfdbb834804a00f6d9c5
branch: main
author: Gabriele N. Tornetta <[email protected]>
committer: markshannon <[email protected]>
date: 2025-12-16T16:23:27Z
summary:

Make RESUME monitoring more readable and robust (GH-142136)

files:
M Python/bytecodes.c
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 0dbfe962684e20..391fa8ea2a94ec 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -240,7 +240,7 @@ dummy_func(
 
         op(_MONITOR_RESUME, (--)) {
             int err = _Py_call_instrumentation(
-                    tstate, oparg > 0, frame, this_instr);
+                    tstate, oparg == 0 ? PY_MONITORING_EVENT_PY_START : 
PY_MONITORING_EVENT_PY_RESUME, frame, this_instr);
             ERROR_IF(err);
             if (frame->instr_ptr != this_instr) {
                 /* Instrumentation has jumped */
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 2811a2ec8ac82d..94846d718308a5 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -7196,7 +7196,7 @@
             {
                 _PyFrame_SetStackPointer(frame, stack_pointer);
                 int err = _Py_call_instrumentation(
-                    tstate, oparg > 0, frame, this_instr);
+                    tstate, oparg == 0 ? PY_MONITORING_EVENT_PY_START : 
PY_MONITORING_EVENT_PY_RESUME, frame, this_instr);
                 stack_pointer = _PyFrame_GetStackPointer(frame);
                 if (err) {
                     JUMP_TO_LABEL(error);

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to