diff options
-rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 4930433..afc480e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2966,15 +2966,17 @@ maybe_call_line_trace(int opcode, Py_tracefunc func, PyObject *obj, if (addr + *p > frame->f_lasti) break; addr += *p++; + if (*p) *instr_lb = addr; line += *p++; --size; } + if (addr == frame->f_lasti) { frame->f_lineno = line; call_trace(func, obj, frame, PyTrace_LINE, Py_None); } - *instr_lb = addr; + if (size > 0) { while (--size >= 0) { addr += *p++; |