Skip to content

Commit 143dfe8

Browse files
committed
Support FREE dce with T = QM_ASSIGN src
1 parent dba2294 commit 143dfe8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Zend/Optimizer/block_pass.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,17 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
289289
MAKE_NOP(opline);
290290
++(*opt_count);
291291
break;
292+
case ZEND_QM_ASSIGN:
293+
src->result_type = IS_UNUSED;
294+
VAR_SOURCE(opline->op1) = NULL;
295+
MAKE_NOP(opline);
296+
++(*opt_count);
297+
if (src->op1_type & (IS_VAR|IS_TMP_VAR)) {
298+
src->opcode = ZEND_FREE;
299+
} else {
300+
MAKE_NOP(src);
301+
}
302+
break;
292303
default:
293304
if (!zend_op_may_elide_result(src->opcode)) {
294305
break;

0 commit comments

Comments
 (0)