1
0
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:
Dmitry Stogov
2023-10-25 14:57:58 +03:00
parent 9f5a4c3799
commit a96ea5d235
2 changed files with 32 additions and 7 deletions

View File

@@ -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);
}
}

View 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