@@ -3098,8 +3098,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z
30983098 bool do_bailout = 0 ;
30993099
31003100 zend_shared_alloc_lock ();
3101+ jit_extension = (zend_jit_op_array_extension * )ZEND_FUNC_INFO (op_array );
31013102
3102- if (ZEND_FUNC_INFO ( op_array )) {
3103+ if (jit_extension && !( jit_extension -> func_info . flags & ZEND_FUNC_JITED )) {
31033104
31043105 SHM_UNPROTECT ();
31053106 zend_jit_unprotect ();
@@ -3111,11 +3112,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV zend_runtime_jit(Z
31113112 opline ++ ;
31123113 }
31133114 }
3114- jit_extension = (zend_jit_op_array_extension * )ZEND_FUNC_INFO (op_array );
31153115 ((zend_op * )opline )-> handler = jit_extension -> orig_handler ;
31163116
31173117 /* perform real JIT for this function */
31183118 zend_real_jit_func (op_array , NULL , NULL , ZEND_JIT_ON_FIRST_EXEC );
3119+
3120+ jit_extension -> func_info .flags |= ZEND_FUNC_JITED ;
31193121 } zend_catch {
31203122 do_bailout = true;
31213123 } zend_end_try ();
@@ -3182,7 +3184,7 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend
31823184 zend_shared_alloc_lock ();
31833185 jit_extension = (zend_jit_op_array_hot_extension * )ZEND_FUNC_INFO (op_array );
31843186
3185- if (jit_extension ) {
3187+ if (jit_extension && !( jit_extension -> func_info . flags & ZEND_FUNC_JITED ) ) {
31863188 SHM_UNPROTECT ();
31873189 zend_jit_unprotect ();
31883190
@@ -3195,6 +3197,8 @@ void ZEND_FASTCALL zend_jit_hot_func(zend_execute_data *execute_data, const zend
31953197
31963198 /* perform real JIT for this function */
31973199 zend_real_jit_func (op_array , NULL , opline , ZEND_JIT_ON_HOT_COUNTERS );
3200+
3201+ jit_extension -> func_info .flags |= ZEND_FUNC_JITED ;
31983202 } zend_catch {
31993203 do_bailout = 1 ;
32003204 } zend_end_try ();
0 commit comments