Skip to content

Commit ffb62d9

Browse files
Fix a bug in the JIT with many local variables
1 parent c87b66b commit ffb62d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Python/optimizer_analysis.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,19 @@ optimize_uops(
482482
_PyUOpInstruction *corresponding_check_stack = NULL;
483483

484484
_Py_uop_abstractcontext_init(ctx);
485+
486+
// Note: this must happen before frame_new, as it might override
487+
// the result should frame_new set things to bottom.
488+
ctx->done = false;
489+
ctx->out_of_space = false;
490+
ctx->contradiction = false;
491+
485492
_Py_UOpsAbstractFrame *frame = _Py_uop_frame_new(ctx, co, curr_stacklen, NULL, 0);
486493
if (frame == NULL) {
487494
return -1;
488495
}
489496
ctx->curr_frame_depth++;
490497
ctx->frame = frame;
491-
ctx->done = false;
492-
ctx->out_of_space = false;
493-
ctx->contradiction = false;
494498

495499
_PyUOpInstruction *this_instr = NULL;
496500
for (int i = 0; !ctx->done; i++) {

0 commit comments

Comments
 (0)