@@ -4831,7 +4831,11 @@ static int zend_jit_math_helper(dasm_State **Dst,
4831
4831
| FREE_OP op1_type, op1, op1_info, 0, opline
4832
4832
| FREE_OP op2_type, op2, op2_info, 0, opline
4833
4833
if (may_throw) {
4834
- zend_jit_check_exception(Dst);
4834
+ if (Z_MODE(res_addr) == IS_MEM_ZVAL && Z_REG(res_addr) == ZREG_RX) {
4835
+ zend_jit_check_exception_undef_result(Dst, opline);
4836
+ } else {
4837
+ zend_jit_check_exception(Dst);
4838
+ }
4835
4839
}
4836
4840
if (Z_MODE(res_addr) == IS_REG) {
4837
4841
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, res_var);
@@ -5167,7 +5171,11 @@ static int zend_jit_long_math_helper(dasm_State **Dst,
5167
5171
| FREE_OP op1_type, op1, op1_info, 0, opline
5168
5172
| FREE_OP op2_type, op2, op2_info, 0, opline
5169
5173
if (may_throw) {
5170
- zend_jit_check_exception(Dst);
5174
+ if (Z_MODE(res_addr) == IS_MEM_ZVAL && Z_REG(res_addr) == ZREG_RX) {
5175
+ zend_jit_check_exception_undef_result(Dst, opline);
5176
+ } else {
5177
+ zend_jit_check_exception(Dst);
5178
+ }
5171
5179
}
5172
5180
if (Z_MODE(res_addr) == IS_REG) {
5173
5181
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, res_var);
@@ -5281,7 +5289,11 @@ static int zend_jit_concat_helper(dasm_State **Dst,
5281
5289
| FREE_OP op1_type, op1, op1_info, 0, opline
5282
5290
| FREE_OP op2_type, op2, op2_info, 0, opline
5283
5291
if (may_throw) {
5284
- zend_jit_check_exception(Dst);
5292
+ if (Z_MODE(res_addr) == IS_MEM_ZVAL && Z_REG(res_addr) == ZREG_RX) {
5293
+ zend_jit_check_exception_undef_result(Dst, opline);
5294
+ } else {
5295
+ zend_jit_check_exception(Dst);
5296
+ }
5285
5297
}
5286
5298
#if 1
5287
5299
if ((op1_info & MAY_BE_STRING) && (op2_info & MAY_BE_STRING)) {
0 commit comments