Skip to content

Commit 94b8c2d

Browse files
committedSep 26, 2022
Fixed type inference
Fixes oss-fuzz #51640
1 parent 2ed103f commit 94b8c2d

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed
 

‎Zend/Optimizer/zend_inference.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2322,9 +2322,9 @@ static zend_always_inline zend_result _zend_update_type_info(
23222322
if (ssa_op->op2_def >= 0 && !(ssa_var_info[ssa_op->op2_def].type & MAY_BE_REF)) {
23232323
UPDATE_SSA_TYPE(tmp, ssa_op->op2_def);
23242324
}
2325-
if (opline->opcode == ZEND_ASSIGN_OP
2326-
|| opline->opcode == ZEND_ASSIGN_DIM_OP
2325+
if (opline->opcode == ZEND_ASSIGN_DIM_OP
23272326
|| opline->opcode == ZEND_ASSIGN_OBJ_OP
2327+
|| opline->opcode == ZEND_ASSIGN_STATIC_PROP_OP
23282328
|| opline->opcode == ZEND_ASSIGN_DIM
23292329
|| opline->opcode == ZEND_ASSIGN_OBJ) {
23302330
if ((ssa_op+1)->op1_def >= 0 && !(ssa_var_info[(ssa_op+1)->op1_def].type & MAY_BE_REF)) {
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Type inference 021;
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
--FILE--
8+
<?php
9+
function foo() {
10+
for(;;){
11+
$b->y++;
12+
$b *= $a;
13+
$a++;
14+
}
15+
}
16+
?>
17+
DONE
18+
--EXPECT--
19+
DONE

0 commit comments

Comments
 (0)