|
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"
|
@@ -7562,7 +7563,10 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32
|
7562 | 7563 | }
|
7563 | 7564 |
|
7564 | 7565 | if (Z_MODE(op1_addr) == IS_CONST_ZVAL) {
|
7565 |
| - if (zend_is_true(Z_ZV(op1_addr))) { |
| 7566 | + zval *op1 = Z_ZV(op1_addr); |
| 7567 | + /* NAN Value must cause a warning to be emitted */ |
| 7568 | + // TODO function JIT does not emit warning |
| 7569 | + if ((Z_TYPE_P(op1) == IS_DOUBLE && zend_isnan(Z_DVAL_P(op1))) || zend_is_true(op1)) { |
7566 | 7570 | always_true = 1;
|
7567 | 7571 | } else {
|
7568 | 7572 | always_false = 1;
|
@@ -7730,10 +7734,11 @@ static int zend_jit_bool_jmpznz(zend_jit_ctx *jit, const zend_op *opline, uint32
|
7730 | 7734 | ir_IF_TRUE(if_double);
|
7731 | 7735 | }
|
7732 | 7736 |
|
7733 |
| - ir_ref dval = jit_Z_DVAL(jit, op1_addr);ir_ref is_nan = ir_NE(dval, dval); |
| 7737 | + ir_ref dval = jit_Z_DVAL(jit, op1_addr); |
| 7738 | + ir_ref is_nan = ir_NE(dval, dval); |
7734 | 7739 | ir_ref if_val = ir_IF(is_nan);
|
7735 | 7740 | ir_IF_TRUE_cold(if_val);
|
7736 |
| - ir_CALL(IR_VOID, ir_CONST_FC_FUNC(zend_jit_check_nan_to_bool_coercion)); |
| 7741 | + ir_CALL(IR_VOID, ir_CONST_FC_FUNC(zend_jit_nan_coerced_to_type_warning)); |
7737 | 7742 | ir_MERGE_WITH_EMPTY_FALSE(if_val);
|
7738 | 7743 |
|
7739 | 7744 | ref = ir_NE(dval, ir_CONST_DOUBLE(0.0));
|
|
0 commit comments