https://github.com/python/cpython/commit/ca99bfdefb7093d9287353b7d1db97222a414b0e
commit: ca99bfdefb7093d9287353b7d1db97222a414b0e
branch: main
author: Ken Jin <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2026-01-24T09:36:40Z
summary:

gh-144016: Fix bad stack assert in the JIT optimizer (GH-144019)

files:
M Python/optimizer_analysis.c

diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index c6a1ae60a317fa..6c381ab184fd85 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -507,7 +507,7 @@ optimize_uops(
             *(ctx->out_buffer.next++) = *this_instr;
         }
         assert(ctx->frame != NULL);
-        if (!CURRENT_FRAME_IS_INIT_SHIM()) {
+        if (!CURRENT_FRAME_IS_INIT_SHIM() && !ctx->done) {
             DPRINTF(3, " stack_level %d\n", STACK_LEVEL());
             ctx->frame->stack_pointer = stack_pointer;
             assert(STACK_LEVEL() >= 0);

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to