mirror of
https://github.com/php/php-src.git
synced 2025-01-09 20:44:33 +08:00
JIT: Fixed incorrect overflow detection introduced in a5e502ef4d
This commit is contained in:
parent
80205cd39a
commit
831a1717f6
@ -12823,6 +12823,8 @@ static int zend_jit_incdec_obj(dasm_State **Dst,
|
||||
}
|
||||
if (opline->result_type != IS_UNUSED
|
||||
&& (opline->opcode == ZEND_PRE_INC_OBJ || opline->opcode == ZEND_PRE_DEC_OBJ)
|
||||
&& prop_info
|
||||
&& !ZEND_TYPE_IS_SET(prop_info->type)
|
||||
&& (res_info & MAY_BE_GUARD)
|
||||
&& (res_info & MAY_BE_LONG)) {
|
||||
int32_t exit_point = zend_jit_trace_get_exit_point(opline + 1, 0);
|
||||
|
@ -13549,6 +13549,8 @@ static int zend_jit_incdec_obj(dasm_State **Dst,
|
||||
}
|
||||
if (opline->result_type != IS_UNUSED
|
||||
&& (opline->opcode == ZEND_PRE_INC_OBJ || opline->opcode == ZEND_PRE_DEC_OBJ)
|
||||
&& prop_info
|
||||
&& !ZEND_TYPE_IS_SET(prop_info->type)
|
||||
&& (res_info & MAY_BE_GUARD)
|
||||
&& (res_info & MAY_BE_LONG)) {
|
||||
int32_t exit_point = zend_jit_trace_get_exit_point(opline + 1, 0);
|
||||
|
@ -6,7 +6,6 @@ opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
opcache.jit=function
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
|
33
ext/opcache/tests/jit/inc_obj_002.phpt
Normal file
33
ext/opcache/tests/jit/inc_obj_002.phpt
Normal file
@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
PRE_INC_OBJ: 002
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
function foo() {
|
||||
$this->prop = PHP_INT_MAX - 5;
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
var_dump(++$this->prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$test->foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
int(%d)
|
||||
float(%f)
|
||||
float(%f)
|
||||
float(%f)
|
||||
float(%f)
|
||||
float(%f)
|
Loading…
Reference in New Issue
Block a user