From 7d9cb8c30532b2b760da2af3878e3e512f9717d2 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 23 Jan 2023 18:13:14 +0100 Subject: [PATCH] Fix incorrect check condition in type inference The "nothing to do" case would never be hit because the switch block would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP, not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to the else block. Fix this by correcting the check condition. --- Zend/Optimizer/zend_inference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 0654464f108dc..dfb70a3dcabf0 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2505,7 +2505,7 @@ static zend_always_inline int _zend_update_type_info( UPDATE_SSA_TYPE(orig, ssa_op->op1_def); COPY_SSA_OBJ_TYPE(ssa_op->op1_use, ssa_op->op1_def); } - } else if (opline->opcode == ZEND_ASSIGN_STATIC_PROP) { + } else if (opline->opcode == ZEND_ASSIGN_STATIC_PROP_OP) { /* Nothing to do */ } else { if (opline->opcode == ZEND_ASSIGN_OP && ssa_op->result_def >= 0 && (tmp & MAY_BE_RC1)) {