diff --git a/NEWS b/NEWS index 9336ed394c35..362367530207 100644 --- a/NEWS +++ b/NEWS @@ -85,6 +85,9 @@ PHP NEWS zend_jit_assign_dim_op()). (waroad) . Fixed bug GH-24398 (JIT: minimal JIT segfault when a hooked property is passed to a run-time-resolved function). (waroad) + . Fixed tracing JIT returning a wrapped integer instead of a float on + integer overflow after an integer was compared with a float or + numeric-string literal. (Ilia Alshanetsky) - PDO: . Fixed invalid ATTR_ORACLE_NULLS values being accepted and truncated. diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 7c218a62306c..49f4f625f9f0 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -3688,7 +3688,7 @@ static void zend_jit_trace_update_condition_ranges(const zend_op *opline, const zend_long op1_min, op1_max, op2_min, op2_max; if ((OP1_INFO() & MAY_BE_ANY) != MAY_BE_LONG - || (OP1_INFO() & MAY_BE_ANY) != MAY_BE_LONG) { + || (OP2_INFO() & MAY_BE_ANY) != MAY_BE_LONG) { return; } diff --git a/ext/opcache/tests/jit/cmp_010.phpt b/ext/opcache/tests/jit/cmp_010.phpt new file mode 100644 index 000000000000..562e4e1d5d70 --- /dev/null +++ b/ext/opcache/tests/jit/cmp_010.phpt @@ -0,0 +1,57 @@ +--TEST-- +JIT CMP: 010 Integer range must not be narrowed by a comparison with a non-integer operand +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=tracing +opcache.jit_hot_func=1 +opcache.jit_hot_loop=1 +opcache.jit_hot_return=1 +opcache.jit_hot_side_exit=1 +--EXTENSIONS-- +opcache +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int < float: float(9.223372036854776E+18) +int < numeric string: float(9.223372036854776E+18) +int <= float (false): float(-9.223372036854776E+18)