@@ -584,6 +584,7 @@ translate_bytecode_to_trace(
584584 code -> co_firstlineno ,
585585 2 * INSTR_IP (initial_instr , code ));
586586 ADD_TO_TRACE (_START_EXECUTOR , 0 , (uintptr_t )instr , INSTR_IP (instr , code ));
587+ ADD_TO_TRACE (_CHECK_VALIDITY , 0 , 0 , 0 );
587588 ADD_TO_TRACE (_MAKE_WARM , 0 , 0 , 0 );
588589 uint32_t target = 0 ;
589590
@@ -1472,8 +1473,7 @@ _PyExecutor_GetColdExecutor(void)
14721473 return interp -> cold_executor ;
14731474 }
14741475 _PyExecutorObject * cold = allocate_executor (0 , 1 );
1475- assert ((void * )cold -> trace == (void * )cold -> exits );
1476- ((_PyUOpInstruction * )cold -> exits )-> opcode = _COLD_EXIT ;
1476+ ((_PyUOpInstruction * )cold -> trace )-> opcode = _COLD_EXIT ;
14771477 if (cold == NULL ) {
14781478 Py_FatalError ("Cannot allocate core JIT code" );
14791479 }
@@ -1526,16 +1526,11 @@ executor_clear(PyObject *op)
15261526 unlink_executor (executor );
15271527 executor -> vm_data .valid = 0 ;
15281528
1529- _PyExecutorObject * cold = _PyExecutor_GetColdExecutor ();
1530- ((_PyUOpInstruction * )executor -> trace )-> opcode = _COLD_EXIT ;
1531- #ifdef _Py_JIT
1532- executor -> jit_code = cold -> jit_code ;
1533- #endif
1534-
15351529 /* It is possible for an executor to form a reference
15361530 * cycle with itself, so decref'ing a side exit could
15371531 * free the executor unless we hold a strong reference to it
15381532 */
1533+ _PyExecutorObject * cold = _PyExecutor_GetColdExecutor ();
15391534 Py_INCREF (executor );
15401535 for (uint32_t i = 0 ; i < executor -> exit_count ; i ++ ) {
15411536 executor -> exits [i ].temperature = initial_unreachable_backoff_counter ();
0 commit comments