summaryrefslogtreecommitdiffstats
path: root/Python/ceval_macros.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-05-12 11:21:20 (GMT)
committerGitHub <noreply@github.com>2023-05-12 11:21:20 (GMT)
commit45f5aa8fc73acf516071d52ef8213532f0381316 (patch)
treebc1f7219305185a7befef7003688d7a4359f98e4 /Python/ceval_macros.h
parent19ee53d52e8adf267dfd588c2142967734a3b65a (diff)
downloadcpython-45f5aa8fc73acf516071d52ef8213532f0381316.zip
cpython-45f5aa8fc73acf516071d52ef8213532f0381316.tar.gz
cpython-45f5aa8fc73acf516071d52ef8213532f0381316.tar.bz2
GH-103082: Filter LINE events in VM, to simplify tool implementation. (GH-104387)
When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
Diffstat (limited to 'Python/ceval_macros.h')
-rw-r--r--Python/ceval_macros.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h
index 485771a..f5515d0 100644
--- a/Python/ceval_macros.h
+++ b/Python/ceval_macros.h
@@ -334,11 +334,10 @@ do { \
#define INSTRUMENTED_JUMP(src, dest, event) \
do { \
_PyFrame_SetStackPointer(frame, stack_pointer); \
- int err = _Py_call_instrumentation_jump(tstate, event, frame, src, dest); \
+ next_instr = _Py_call_instrumentation_jump(tstate, event, frame, src, dest); \
stack_pointer = _PyFrame_GetStackPointer(frame); \
- if (err) { \
+ if (next_instr == NULL) { \
next_instr = (dest)+1; \
goto error; \
} \
- next_instr = frame->prev_instr; \
} while (0);