Skip to content

Commit

Permalink
GH-104584: Restore frame->stacktop on optimizer error (GH-108953)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Sep 6, 2023
1 parent 6f3c138 commit 6971e40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix a crash when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>`
enabled and an error occurs during optimization.
1 change: 1 addition & 0 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ _PyOptimizer_BackEdge(_PyInterpreterFrame *frame, _Py_CODEUNIT *src, _Py_CODEUNI
if (err <= 0) {
assert(executor == NULL);
if (err < 0) {
_PyFrame_SetStackPointer(frame, stack_pointer);
return NULL;
}
goto jump_to_destination;
Expand Down

0 comments on commit 6971e40

Please sign in to comment.