Skip to content

Commit 6be7a84

Browse files
Some comment at _PyOptimizer_Optimize
1 parent 21a6e2b commit 6be7a84

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/optimizer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ _PyOptimizer_Optimize(
119119
_PyStackRef *stack_pointer = frame->stackpointer;
120120
PyInterpreterState *interp = _PyInterpreterState_GET();
121121
if (!interp->jit) {
122+
// gh-140936: It is possible that interp->jit will become false during
123+
// interpreter finalization. However, the specialized JUMP_BACKWARD_JIT
124+
// instruction may still be present. In this case, we should
125+
// return immediately without optimization.
122126
return 0;
123127
}
124128
assert(!interp->compiling);

0 commit comments

Comments
 (0)