Skip to content

Commit 6971e40

Browse files
authored
GH-104584: Restore frame->stacktop on optimizer error (GH-108953)
1 parent 6f3c138 commit 6971e40

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a crash when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>`
2+
enabled and an error occurs during optimization.

Diff for: Python/optimizer.c

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ _PyOptimizer_BackEdge(_PyInterpreterFrame *frame, _Py_CODEUNIT *src, _Py_CODEUNI
169169
if (err <= 0) {
170170
assert(executor == NULL);
171171
if (err < 0) {
172+
_PyFrame_SetStackPointer(frame, stack_pointer);
172173
return NULL;
173174
}
174175
goto jump_to_destination;

0 commit comments

Comments
 (0)