summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-10-03 09:53:11 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-10-03 09:53:11 (GMT)
commitca803a0dd7799167c8d04451547a9c03db1ce23c (patch)
treee49df3e010c479c2dc8314d771e64b2ff58281aa /Python/ceval.c
parent3ae3315f44c5a6f462844e51c830593f007ef881 (diff)
downloadcpython-ca803a0dd7799167c8d04451547a9c03db1ce23c.zip
cpython-ca803a0dd7799167c8d04451547a9c03db1ce23c.tar.gz
cpython-ca803a0dd7799167c8d04451547a9c03db1ce23c.tar.bz2
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c4
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++;