|
16 | 16 | * +----------------------------------------------------------------------+ |
17 | 17 | */ |
18 | 18 |
|
| 19 | +#include "../../../Zend/zend_types.h" |
19 | 20 | #include "Zend/zend_type_info.h" |
20 | 21 | #include "jit/ir/ir.h" |
21 | 22 | #include "jit/ir/ir_builder.h" |
@@ -7570,7 +7571,10 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 |
7570 | 7571 | } |
7571 | 7572 |
|
7572 | 7573 | if (Z_MODE(op1_addr) == IS_CONST_ZVAL) { |
7573 | | - if (zend_is_true(Z_ZV(op1_addr))) { |
| 7574 | + zval *op1 = Z_ZV(op1_addr); |
| 7575 | + /* NAN Value must cause a warning to be emitted */ |
| 7576 | + // TODO function JIT does not emit warning |
| 7577 | + if ((Z_TYPE_P(op1) == IS_DOUBLE && zend_isnan(Z_DVAL_P(op1))) || zend_is_true(op1)) { |
7574 | 7578 | always_true = 1; |
7575 | 7579 | } else { |
7576 | 7580 | always_false = 1; |
@@ -7738,10 +7742,11 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32 |
7738 | 7742 | ir_IF_TRUE(if_double); |
7739 | 7743 | } |
7740 | 7744 |
|
7741 | | - ir_ref dval = jit_Z_DVAL(jit, op1_addr);ir_ref is_nan = ir_NE(dval, dval); |
| 7745 | + ir_ref dval = jit_Z_DVAL(jit, op1_addr); |
| 7746 | + ir_ref is_nan = ir_NE(dval, dval); |
7742 | 7747 | ir_ref if_val = ir_IF(is_nan); |
7743 | 7748 | ir_IF_TRUE_cold(if_val); |
7744 | | - ir_CALL(IR_VOID, ir_CONST_FC_FUNC(zend_jit_check_nan_to_bool_coercion)); |
| 7749 | + ir_CALL(IR_VOID, ir_CONST_FC_FUNC(zend_jit_nan_coerced_to_type_warning)); |
7745 | 7750 | ir_MERGE_WITH_EMPTY_FALSE(if_val); |
7746 | 7751 |
|
7747 | 7752 | ref = ir_NE(dval, ir_CONST_DOUBLE(0.0)); |
|
0 commit comments