10000 remove unecessary setting of prev_instr in _Py_call_instrumentation_jump · python/cpython@909de93 · GitHub
[go: up one dir, main page]

Skip to content

Commit 909de93

Browse files
committed
remove unecessary setting of prev_instr in _Py_call_instrumentation_jump
1 parent 58d3bc5 commit 909de93

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Python/instrumentation.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,6 @@ _Py_call_instrumentation_jump(
10581058
event == PY_MONITORING_EVENT_BRANCH);
10591059
assert(frame->prev_instr == instr);
10601060
/* Event should occur after the jump */
1061-
frame->prev_instr = target;
10621061
PyCodeObject *code = _PyFrame_GetCode(frame);
10631062
int to = (int)(target - _PyCode_CODE(code));
10641063
PyObject *to_obj = PyLong_FromLong(to * (int)sizeof(_Py_CODEUNIT));
@@ -1071,12 +1070,10 @@ _Py_call_instrumentation_jump(
10711070
if (err) {
10721071
return NULL;
10731072
}
1074-
if (frame->prev_instr != target) {
1073+
if (frame->prev_instr != instr) {
10751074
/* The callback has caused a jump (by setting the line number) */
10761075
return frame->prev_instr;
10771076
}
1078-
/* Reset prev_instr for INSTRUMENTED_LINE */
1079-
frame->prev_instr = instr;
10801077
return target;
10811078
}
10821079

0 commit comments

Comments
 (0)
0