Uh oh!
There was an error while loading. Please reload this page.
gh-140104: Set next_instr properly in the JIT during exceptions - #140233
Conversation
Co-Authored-By: devdanzin <74280297+devdanzin@users.noreply.github.com>
devdanzin
commented
Oct 16, 2025
This PR fixes all correctness bugs found by the fuzzer so far, thank you! |
Tailcall CI is broken for x86_64-pc-windows-msvc and aarch64-pc-windows-msvc. Updating Unfortunately, I cannot test aarch64. Hopefully, this fixes it as well. Would have liked to fail it during compiling like x86_64, not at runtime, though? |
Co-Authored-By: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
markshannon
commented
Oct 21, 2025
|
| next_instr = frame->instr_ptr; \ | ||
| /* gh-140104: The exception handler expects frame->instr_ptr | ||
| to be pointing to next_instr, not this_instr! */ \ | ||
| next_instr = frame->instr_ptr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[frame->instr_ptr->op.code]]; \ |
There was a problem hiding this comment.
| next_instr=frame->instr_ptr+1+_PyOpcode_Caches[_PyOpcode_Deopt[frame->instr_ptr->op.code]]; \ | |
| next_instr=frame->instr_ptr+1; |
Just +1 to compensate for the the -1 in label(exception_unwind)
Pointing to the next instruction does work, but it is unnecessary. As long as next_inst -1 points into the current instruction, unwinding works correctly.
When you're done making the requested changes, leave the comment: |
Uh oh!
There was an error while loading. Please reload this page.
markshannon
commented
Oct 24, 2025
The code looks good now. |
Thanks @Fidget-Spinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, @Fidget-Spinner, I could not cleanly backport this to |
GH-140687 is a backport of this pull request to the 3.14 branch. |
…pythonGH-140233) Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com> Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
bedevere-bot
commented
Oct 28, 2025
|
…ring exceptions (pythonGH-140233) (pythonGH-140687)" This reverts commit 2e21672.
GH-141495 is a backport of this pull request to the 3.14 branch. |
…pythonGH-140233) Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com> Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Fixes#140104
UnboundLocalErrorfor same code with JIT on or off #140104