mirror of
https://github.com/python/cpython.git
synced 2026-06-30 22:56:21 -04:00
[3.15] gh-152375: Fix undefined behaviour in the INSTRUMENTED_JUMP macro (GH-152376) (#152566)
(cherry picked from commit cdec9acd63)
Co-authored-by: Stan Ulbrych <stan@python.org>
This commit is contained in:
committed by
GitHub
parent
1db0c66246
commit
00a43044d8
@@ -0,0 +1,2 @@
|
||||
Fix undefined behaviour when a :mod:`sys.monitoring` callback raised an
|
||||
exception while the program was following a branch or loop.
|
||||
@@ -388,14 +388,15 @@ static void dtrace_function_return(_PyInterpreterFrame *);
|
||||
// for an exception handler, displaying the traceback, and so on
|
||||
#define INSTRUMENTED_JUMP(src, dest, event) \
|
||||
do { \
|
||||
_Py_CODEUNIT *_dest = (dest); \
|
||||
if (tstate->tracing) {\
|
||||
next_instr = dest; \
|
||||
next_instr = _dest; \
|
||||
} else { \
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
||||
next_instr = _Py_call_instrumentation_jump(this_instr, tstate, event, frame, src, dest); \
|
||||
next_instr = _Py_call_instrumentation_jump(this_instr, tstate, event, frame, src, _dest); \
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
||||
if (next_instr == NULL) { \
|
||||
next_instr = (dest)+1; \
|
||||
next_instr = _dest + 1; \
|
||||
JUMP_TO_LABEL(error); \
|
||||
} \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user