From 42190b6548f5b44b27e6053971fa2b755801baa3 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 5 Sep 2023 11:12:12 -0700 Subject: [PATCH 1/2] Restore stack_pointer on optimizer error --- Python/optimizer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/optimizer.c b/Python/optimizer.c index 7472f52c50b766..fac1a6f0fdee47 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -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; From 453da35c023d1c7adcbd6e022b566e7b2f753808 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 5 Sep 2023 11:31:38 -0700 Subject: [PATCH 2/2] blurb add --- .../2023-09-05-11-31-27.gh-issue-104584.IRSXA2.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-09-05-11-31-27.gh-issue-104584.IRSXA2.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-09-05-11-31-27.gh-issue-104584.IRSXA2.rst b/Misc/NEWS.d/next/Core and Builtins/2023-09-05-11-31-27.gh-issue-104584.IRSXA2.rst new file mode 100644 index 00000000000000..7f556bf8c31c11 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-09-05-11-31-27.gh-issue-104584.IRSXA2.rst @@ -0,0 +1,2 @@ +Fix a crash when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` +enabled and an error occurs during optimization.