@@ -8691,6 +8691,7 @@ static int zend_jit_push_call_frame(zend_jit_ctx *jit, const zend_op *opline, co
8691
8691
ir_STORE(jit_CALL(rx, This), IR_NULL);
8692
8692
} else {
8693
8693
ir_ref object_or_called_scope, call_info, call_info2, object, if_cond;
8694
+ ir_ref if_cond_user = IR_UNUSED;
8694
8695
8695
8696
if (opline->op2_type == IS_CV) {
8696
8697
// JIT: GC_ADDREF(closure);
@@ -8728,15 +8729,22 @@ static int zend_jit_push_call_frame(zend_jit_ctx *jit, const zend_op *opline, co
8728
8729
// JIT: Z_PTR(call->This) = object_or_called_scope;
8729
8730
ir_STORE(jit_CALL(rx, This.value.ptr), object_or_called_scope);
8730
8731
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
+ }
8734
8738
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
+ }
8738
8744
8739
- ir_MERGE_WITH_EMPTY_TRUE(if_cond);
8745
+ if (!func) {
8746
+ ir_MERGE_WITH_EMPTY_FALSE(if_cond_user);
8747
+ }
8740
8748
}
8741
8749
8742
8750
// JIT: ZEND_CALL_NUM_ARGS(call) = num_args;
0 commit comments