Skip to content

Commit 59506ca

Browse files
committed
Make RESUME monitoring more readable and robust
We make the code for the monitoring of PY_START and PY_RESUME events triggered by the RESUME opcode more readable and maintainable by not relying on some obscure logic on the value of oparg that can easily break if the event IDs are ever changed in the future.
1 parent b708485 commit 59506ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/bytecodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ dummy_func(
240240

241241
op(_MONITOR_RESUME, (--)) {
242242
int err = _Py_call_instrumentation(
243-
tstate, oparg > 0, frame, this_instr);
243+
tstate, oparg == 0 ? PY_MONITORING_EVENT_PY_START : PY_MONITORING_EVENT_PY_RESUME, frame, this_instr);
244244
ERROR_IF(err);
245245
if (frame->instr_ptr != this_instr) {
246246
/* Instrumentation has jumped */

0 commit comments

Comments
 (0)