Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
57 changes: 57 additions & 0 deletions ext/opcache/tests/jit/cmp_010.phpt
Original file line number Diff line number Diff line change
@@ -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--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
function lt_float(int $x) {
if ($x < 1.0e19) {
return $x + 1;
}
return 0;
}
function lt_string(int $x) {
if ($x < "1e19") {
return $x + 1;
}
return 0;
}
function le_float(int $x) {
if ($x <= -1.0e19) {
return 0;
}
return $x - 1;
}
foreach ([1, 2, 3, PHP_INT_MAX] as $v) {
$r = lt_float($v);
}
echo "int < float: ";
var_dump($r);
foreach ([1, 2, 3, PHP_INT_MAX] as $v) {
$r = lt_string($v);
}
echo "int < numeric string: ";
var_dump($r);
foreach ([1, 2, 3, PHP_INT_MIN] as $v) {
$r = le_float($v);
}
echo "int <= float (false): ";
var_dump($r);
?>
--EXPECT--
int < float: float(9.223372036854776E+18)
int < numeric string: float(9.223372036854776E+18)
int <= float (false): float(-9.223372036854776E+18)
Loading