Skip to content

Commit

Permalink
remove prev_instr manipulation from _Py_call_instrumentation_jump
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Sep 6, 2023
1 parent 6971e40 commit a7448e6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Python/instrumentation.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ _Py_call_instrumentation_jump(
event == PY_MONITORING_EVENT_BRANCH);
assert(frame->prev_instr == instr);
/* Event should occur after the jump */
frame->prev_instr = target;
PyCodeObject *code = _PyFrame_GetCode(frame);
int to = (int)(target - _PyCode_CODE(code));
PyObject *to_obj = PyLong_FromLong(to * (int)sizeof(_Py_CODEUNIT));
Expand All @@ -1091,12 +1090,10 @@ _Py_call_instrumentation_jump(
if (err) {
return NULL;
}
if (frame->prev_instr != target) {
if (frame->prev_instr != instr) {
/* The callback has caused a jump (by setting the line number) */
return frame->prev_instr;
}
/* Reset prev_instr for INSTRUMENTED_LINE */
frame->prev_instr = instr;
return target;
}

Expand Down

0 comments on commit a7448e6

Please sign in to comment.