From fb4405d357e2876f7719d19d47c007d86a05e390 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 15 Sep 2021 14:44:54 +0200 Subject: [PATCH] Avoid accessing literal operand on nop This would have create a NOP with a CONST operand ... probably harmless in practice, but we should avoid it. --- Zend/Optimizer/zend_optimizer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend/Optimizer/zend_optimizer.c b/Zend/Optimizer/zend_optimizer.c index 66a27bd9c74..1ac1e09b2c6 100644 --- a/Zend/Optimizer/zend_optimizer.c +++ b/Zend/Optimizer/zend_optimizer.c @@ -305,6 +305,7 @@ int zend_optimizer_update_op1_const(zend_op_array *op_array, opline->op1.constant = zend_optimizer_add_literal(op_array, val); if (Z_TYPE_P(val) == IS_STRING && Z_STRLEN_P(val) == 0) { MAKE_NOP(opline); + return 1; } /* TODO: In a subsequent pass, *after* this step and compacting nops, combine consecutive ZEND_ECHOs using the block information from ssa->cfg */ /* (e.g. for ext/opcache/tests/opt/sccp_010.phpt) */