mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fixed codegeneration for INC_OBJ
This commit is contained in:
@@ -14723,13 +14723,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit,
|
||||
jit_ZVAL_ADDR(jit, op1_addr),
|
||||
ir_CONST_ADDR(ZSTR_VAL(name)));
|
||||
|
||||
may_throw = 1;
|
||||
|
||||
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !delayed_fetch_this && !op1_indirect) {
|
||||
ir_END_list(end_inputs);
|
||||
} else {
|
||||
ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler));
|
||||
}
|
||||
ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler));
|
||||
ir_IF_TRUE(if_obj);
|
||||
}
|
||||
}
|
||||
|
||||
31
ext/opcache/tests/jit/inc_obj_006.phpt
Normal file
31
ext/opcache/tests/jit/inc_obj_006.phpt
Normal file
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
PRE_INC_OBJ: 006
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new class {
|
||||
public int $foo = 0;
|
||||
|
||||
function &__get($x) {
|
||||
return $this->foo;
|
||||
}
|
||||
|
||||
function __set($x, $y) {
|
||||
echo "set($y)\n";
|
||||
}
|
||||
};
|
||||
|
||||
--$a->x->y;
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on int in %sinc_obj_006.php:14
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sinc_obj_006.php on line 14
|
||||
|
||||
Reference in New Issue
Block a user