Skip to content

Commit 6694ecd

Browse files
committed
Fix live_range updates on ZEND(_FE)_FREE opcodes in block_pass
1 parent 56f1106 commit 6694ecd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/opcache/Optimizer/block_pass.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,8 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
955955
op_array->last_live_range = j;
956956
while (opline != end) {
957957
if ((opline->opcode == ZEND_FREE || opline->opcode == ZEND_FE_FREE) &&
958-
opline->extended_value == ZEND_FREE_ON_RETURN &&
959-
opline->op2.num < (uint32_t)j) {
958+
opline->extended_value == ZEND_FREE_ON_RETURN) {
959+
ZEND_ASSERT(opline->op2.num < (uint32_t) i);
960960
opline->op2.num = map[opline->op2.num];
961961
}
962962
opline++;
@@ -982,7 +982,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
982982
*opline_num = -1;
983983
}
984984

985-
/* rebild map (judt for printing) */
985+
/* rebild map (just for printing) */
986986
memset(cfg->map, -1, sizeof(int) * op_array->last);
987987
for (n = 0; n < cfg->blocks_count; n++) {
988988
if (cfg->blocks[n].flags & ZEND_BB_REACHABLE) {

0 commit comments

Comments
 (0)