mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)
This commit is contained in:
parent
91a8f8c16c
commit
da6414f0ac
2 changed files with 37 additions and 4 deletions
|
@ -5476,10 +5476,8 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
|
|||
int lastline = _PyCode_CheckLineNumber(instr_prev*2, &tstate->trace_info.bounds);
|
||||
int line = _PyCode_CheckLineNumber(frame->f_lasti*2, &tstate->trace_info.bounds);
|
||||
if (line != -1 && frame->f_trace_lines) {
|
||||
/* Trace backward edges or first instruction of a new line */
|
||||
if (frame->f_lasti < instr_prev ||
|
||||
(line != lastline && frame->f_lasti*2 == tstate->trace_info.bounds.ar_start))
|
||||
{
|
||||
/* Trace backward edges or if line number has changed */
|
||||
if (frame->f_lasti < instr_prev || line != lastline) {
|
||||
result = call_trace(func, obj, tstate, frame, PyTrace_LINE, Py_None);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue