From: Michael W. Hudson Date: Thu, 3 Oct 2002 09:53:11 +0000 (+0000) Subject: One last tweak to the tracing machinery: this actually computes what I intended X-Git-Tag: v2.3c1~3898 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca803a0dd7799167c8d04451547a9c03db1ce23c;p=thirdparty%2FPython%2Fcpython.git One last tweak to the tracing machinery: this actually computes what I intended all along. Before instr_lb tended to be too high. I don't think this actually makes any difference, given what the compiler produces, but it makes me a bit happier. --- diff --git a/Python/ceval.c b/Python/ceval.c index 493043303e8e..afc480e151e2 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++;