[3.14] gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233) (GH-140687)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
This commit is contained in:
Mikhail Efimov 2025-10-28 02:49:10 +03:00 committed by GitHub
parent 3bb0eb4ca9
commit 2e21672803
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 1 deletions

View file

@ -368,7 +368,9 @@ do { \
frame = tstate->current_frame; \
stack_pointer = _PyFrame_GetStackPointer(frame); \
if (next_instr == NULL) { \
next_instr = frame->instr_ptr; \
/* gh-140104: The exception handler expects frame->instr_ptr
to after this_instr, not this_instr! */ \
next_instr = frame->instr_ptr + 1; \
JUMP_TO_LABEL(error); \
} \
DISPATCH(); \