From b97a080034dbe528369436d9b5713db21dba577b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 May 2021 11:10:32 +0200 Subject: [PATCH] Remove special UNREACHABLE_FREE handling in block pass This results in an assertion failure when running under -e, because there is an additional EXT_STMT + NOP before the FREE. I don't think there's a strong reason to handle UNREACHABLE_FREE specially here (it's only important that we *do* handle it), so I'm dropping the code rather than adjusting it to scan over certain opcodes. --- Zend/Optimizer/block_pass.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Zend/Optimizer/block_pass.c b/Zend/Optimizer/block_pass.c index af78ef5b5ed..61c8f420aa4 100644 --- a/Zend/Optimizer/block_pass.c +++ b/Zend/Optimizer/block_pass.c @@ -967,14 +967,6 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array, zend_op continue; } if (b->flags & (ZEND_BB_REACHABLE|ZEND_BB_UNREACHABLE_FREE)) { - if (b->flags & ZEND_BB_UNREACHABLE_FREE) { - /* Only keep the FREE for the loop var */ - ZEND_ASSERT(op_array->opcodes[b->start].opcode == ZEND_FREE - || op_array->opcodes[b->start].opcode == ZEND_FE_FREE); - len += b->len = 1; - continue; - } - opline = op_array->opcodes + b->start + b->len - 1; if (opline->opcode == ZEND_JMP) { zend_basic_block *next = b + 1;