Skip to content

Commit 7a8ffce

Browse files
committed
Fixed type inference for OP_DATA
1 parent 29fa4d2 commit 7a8ffce

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,18 @@ static void add_usages(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset
19471947
if (op->op2_def >= 0) {
19481948
zend_bitset_incl(worklist, op->op2_def);
19491949
}
1950+
} else if (use + 1 < op_array->last
1951+
&& op_array->opcodes[use + 1].opcode == ZEND_OP_DATA) {
1952+
op++;
1953+
if (op->result_def >= 0) {
1954+
zend_bitset_incl(worklist, op->result_def);
1955+
}
1956+
if (op->op1_def >= 0) {
1957+
zend_bitset_incl(worklist, op->op1_def);
1958+
}
1959+
if (op->op2_def >= 0) {
1960+
zend_bitset_incl(worklist, op->op2_def);
1961+
}
19501962
}
19511963
use = zend_ssa_next_use(ssa->ops, var, use);
19521964
} while (use >= 0);

0 commit comments

Comments
 (0)