FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make RESUME monitoring more readable and robust by P403n1x87 · Pull Request #142136 · python/cpython · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Next Next commit
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.
  • Loading branch information
P403n1x87 committed Dec 1, 2025
commit 59506ca06c54944df1eb25b16623c2a6b8e28c04
2 changes: 1 addition & 1 deletion Python/bytecodes.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading

Back | FazBrowse Home | New Git URL