@@ -8691,6 +8691,7 @@ static int zend_jit_push_call_frame(zend_jit_ctx *jit, const zend_op *opline, co
86918691 ir_STORE(jit_CALL(rx, This), IR_NULL);
86928692 } else {
86938693 ir_ref object_or_called_scope, call_info, call_info2, object, if_cond;
8694+ ir_ref if_cond_user = IR_UNUSED;
86948695
86958696 if (opline->op2_type == IS_CV) {
86968697 // JIT: GC_ADDREF(closure);
@@ -8728,15 +8729,22 @@ static int zend_jit_push_call_frame(zend_jit_ctx *jit, const zend_op *opline, co
87288729 // JIT: Z_PTR(call->This) = object_or_called_scope;
87298730 ir_STORE(jit_CALL(rx, This.value.ptr), object_or_called_scope);
87308731
8731- // JIT: if (closure->func.op_array.run_time_cache__ptr)
8732- if_cond = ir_IF(ir_LOAD_A(ir_ADD_OFFSET(func_ref, offsetof(zend_closure, func.op_array.run_time_cache__ptr))));
8733- ir_IF_FALSE(if_cond);
8732+ if (!func) {
8733+ // JIT: if (closure->func.common.type & ZEND_USER_FUNCTION)
8734+ ir_ref type = ir_LOAD_U8(ir_ADD_OFFSET(func_ref, offsetof(zend_closure, func.type)));
8735+ if_cond_user = ir_IF(ir_AND_U8(type, ir_CONST_U8(ZEND_USER_FUNCTION)));
8736+ ir_IF_TRUE(if_cond_user);
8737+ }
87348738
8735- // JIT: zend_jit_init_func_run_time_cache_helper(closure->func);
8736- ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_init_func_run_time_cache_helper),
8737- ir_ADD_OFFSET(func_ref, offsetof(zend_closure, func)));
8739+ if (!func || func->common.type == ZEND_USER_FUNCTION) {
8740+ // JIT: zend_jit_init_func_run_time_cache_helper(closure->func);
8741+ ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_init_func_run_time_cache_helper),
8742+ ir_ADD_OFFSET(func_ref, offsetof(zend_closure, func)));
8743+ }
87388744
8739- ir_MERGE_WITH_EMPTY_TRUE(if_cond);
8745+ if (!func) {
8746+ ir_MERGE_WITH_EMPTY_FALSE(if_cond_user);
8747+ }
87408748 }
87418749
87428750 // JIT: ZEND_CALL_NUM_ARGS(call) = num_args;
0 commit comments