summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge King <george.w.king@gmail.com>2017-10-19 00:44:22 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2017-10-19 00:44:22 (GMT)
commit20faa68bbb912a7b7b056477f5966eff51ff0a65 (patch)
treeb0895dc1c4912a86db0f3ced97001055be15ccca
parent0b6a118a45ac2eded1348fea6ed300d5651f7471 (diff)
downloadcpython-20faa68bbb912a7b7b056477f5966eff51ff0a65.zip
cpython-20faa68bbb912a7b7b056477f5966eff51ff0a65.tar.gz
cpython-20faa68bbb912a7b7b056477f5966eff51ff0a65.tar.bz2
Move opcode tracing to occur after the possible update to f_lineno. (GH-3798)
-rw-r--r--Python/ceval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 86ffec4..0f7a40c 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4416,10 +4416,6 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
*instr_lb = bounds.ap_lower;
*instr_ub = bounds.ap_upper;
}
- /* Always emit an opcode event if we're tracing all opcodes. */
- if (frame->f_trace_opcodes) {
- result = call_trace(func, obj, tstate, frame, PyTrace_OPCODE, Py_None);
- }
/* If the last instruction falls at the start of a line or if it
represents a jump backwards, update the frame's line number and
then call the trace function if we're tracing source lines.
@@ -4430,6 +4426,10 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
result = call_trace(func, obj, tstate, frame, PyTrace_LINE, Py_None);
}
}
+ /* Always emit an opcode event if we're tracing all opcodes. */
+ if (frame->f_trace_opcodes) {
+ result = call_trace(func, obj, tstate, frame, PyTrace_OPCODE, Py_None);
+ }
*instr_prev = frame->f_lasti;
return result;
}