@@ -3864,7 +3864,8 @@ static void zend_jit_type_check_undef(zend_jit_ctx *jit,
3864
3864
uint32_t var,
3865
3865
const zend_op *opline,
3866
3866
bool check_exception,
3867
- bool in_cold_path)
3867
+ bool in_cold_path,
3868
+ bool undef_result)
3868
3869
{
3869
3870
ir_ref if_def = ir_IF(type);
3870
3871
@@ -3878,7 +3879,11 @@ static void zend_jit_type_check_undef(zend_jit_ctx *jit,
3878
3879
}
3879
3880
ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(var));
3880
3881
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
+ }
3882
3887
}
3883
3888
ir_MERGE_WITH_EMPTY_TRUE(if_def);
3884
3889
}
@@ -7301,7 +7306,7 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32
7301
7306
zend_jit_type_check_undef(jit,
7302
7307
type,
7303
7308
opline->op1.var,
7304
- opline, 1, 0);
7309
+ opline, 1, 0, 1 );
7305
7310
}
7306
7311
if (set_bool) {
7307
7312
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,
12201
12206
jit_SET_EX_OPLINE(jit, opline);
12202
12207
if (opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) {
12203
12208
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 );
12205
12210
}
12206
12211
12207
12212
if (op2_info & MAY_BE_UNDEF) {
12208
12213
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 );
12210
12215
}
12211
12216
}
12212
12217
0 commit comments