@@ -3864,7 +3864,8 @@ static void zend_jit_type_check_undef(zend_jit_ctx *jit,
38643864 uint32_t var,
38653865 const zend_op *opline,
38663866 bool check_exception,
3867- bool in_cold_path)
3867+ bool in_cold_path,
3868+ bool undef_result)
38683869{
38693870 ir_ref if_def = ir_IF(type);
38703871
@@ -3878,7 +3879,11 @@ static void zend_jit_type_check_undef(zend_jit_ctx *jit,
38783879 }
38793880 ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(var));
38803881 if (check_exception) {
3881- zend_jit_check_exception(jit);
3882+ if (undef_result) {
3883+ zend_jit_check_exception_undef_result(jit, opline);
3884+ } else {
3885+ zend_jit_check_exception(jit);
3886+ }
38823887 }
38833888 ir_MERGE_WITH_EMPTY_TRUE(if_def);
38843889}
@@ -7301,7 +7306,7 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32
73017306 zend_jit_type_check_undef(jit,
73027307 type,
73037308 opline->op1.var,
7304- opline, 1, 0);
7309+ opline, 1, 0, 1 );
73057310 }
73067311 if (set_bool) {
73077312 jit_set_Z_TYPE_INFO(jit, res_addr, set_bool_not ? IS_TRUE : IS_FALSE);
@@ -12201,12 +12206,12 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit,
1220112206 jit_SET_EX_OPLINE(jit, opline);
1220212207 if (opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) {
1220312208 may_throw = 1;
12204- zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op1_addr), opline->op1.var, NULL, 0, 1);
12209+ zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op1_addr), opline->op1.var, NULL, 0, 1, 0 );
1220512210 }
1220612211
1220712212 if (op2_info & MAY_BE_UNDEF) {
1220812213 may_throw = 1;
12209- zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op2_addr), opline->op2.var, NULL, 0, 1);
12214+ zend_jit_type_check_undef(jit, jit_Z_TYPE(jit, op2_addr), opline->op2.var, NULL, 0, 1, 0 );
1221012215 }
1221112216 }
1221212217
0 commit comments