]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-144016: Fix bad stack assert in the JIT optimizer (GH-144019)
authorKen Jin <kenjin@python.org>
Sat, 24 Jan 2026 09:36:40 +0000 (17:36 +0800)
committerGitHub <noreply@github.com>
Sat, 24 Jan 2026 09:36:40 +0000 (09:36 +0000)
Python/optimizer_analysis.c

index c6a1ae60a317fa4fa3f01070455ed2372893b0e4..6c381ab184fd855c9a457f19843dabe18fdacdb5 100644 (file)
@@ -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);