Skip to content

Commit a96ea5d

Browse files
committed
Fixed codegeneration for INC_OBJ
1 parent 9f5a4c3 commit a96ea5d

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

ext/opcache/jit/zend_jit_ir.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -14723,13 +14723,7 @@ static int zend_jit_incdec_obj(zend_jit_ctx *jit,
1472314723
jit_ZVAL_ADDR(jit, op1_addr),
1472414724
ir_CONST_ADDR(ZSTR_VAL(name)));
1472514725

14726-
may_throw = 1;
14727-
14728-
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !delayed_fetch_this && !op1_indirect) {
14729-
ir_END_list(end_inputs);
14730-
} else {
14731-
ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler));
14732-
}
14726+
ir_IJMP(jit_STUB_ADDR(jit, jit_stub_exception_handler));
1473314727
ir_IF_TRUE(if_obj);
1473414728
}
1473514729
}
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
PRE_INC_OBJ: 006
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
opcache.protect_memory=1
9+
--FILE--
10+
<?php
11+
$a = new class {
12+
public int $foo = 0;
13+
14+
function &__get($x) {
15+
return $this->foo;
16+
}
17+
18+
function __set($x, $y) {
19+
echo "set($y)\n";
20+
}
21+
};
22+
23+
--$a->x->y;
24+
?>
25+
DONE
26+
--EXPECTF--
27+
Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on int in %sinc_obj_006.php:14
28+
Stack trace:
29+
#0 {main}
30+
thrown in %sinc_obj_006.php on line 14
31+

0 commit comments

Comments
 (0)