Skip to content

Commit dc374a0

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fixed incorrect guard
2 parents 6ed3b57 + c3a3054 commit dc374a0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,9 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
20382038
|| Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))[0] == '\0') {
20392039
break;
20402040
}
2041-
ADD_OP1_TRACE_GUARD();
2041+
if (opline->op1_type != IS_UNUSED && op1_type == IS_OBJECT) {
2042+
ADD_OP1_TRACE_GUARD();
2043+
}
20422044
break;
20432045
case ZEND_INIT_METHOD_CALL:
20442046
if (opline->op2_type != IS_CONST
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
JIT: FETCH_OBJ 010
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
function foo() {
11+
for($cnt=0;$cnt<3;$cnt++) {
12+
$obj->ary["bas"] ??= $obj = new stdClass;
13+
}
14+
}
15+
foo();
16+
?>
17+
DONE
18+
--EXPECT--
19+
DONE

0 commit comments

Comments
 (0)