-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
gh-140104: Set next_instr properly in the JIT during exceptions #140233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
a4293bc
55967c9
008979a
d9eb7a9
4f45776
ccc3d64
1e6b2e4
ab4a8c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix a bug with exception handling in the JIT. Patch by Ken Jin. Bug reported | ||
| by Daniel Diniz. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -358,7 +358,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 be pointing to next_instr, not this_instr! */ \ | ||||||
| next_instr = frame->instr_ptr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[frame->instr_ptr->op.code]]; \ | ||||||
|
||||||
| 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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.