Skip to content

Commit 779bd7d

Browse files
committed
Don't make object immortal until it is fully initialized
1 parent 2564d41 commit 779bd7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,6 @@ _PyExecutor_GetColdExecutor(void)
14771477
Py_FatalError("Cannot allocate core JIT code");
14781478
}
14791479
((_PyUOpInstruction *)cold->trace)->opcode = _COLD_EXIT;
1480-
_Py_SetImmortal((PyObject *)cold);
14811480
#ifdef _Py_JIT
14821481
cold->jit_code = NULL;
14831482
cold->jit_side_entry = NULL;
@@ -1490,6 +1489,7 @@ _PyExecutor_GetColdExecutor(void)
14901489
Py_FatalError("Cannot allocate core JIT code");
14911490
}
14921491
#endif
1492+
_Py_SetImmortal((PyObject *)cold);
14931493
interp->cold_executor = cold;
14941494
return cold;
14951495
}

0 commit comments

Comments
 (0)