From c1803bf6528983a760fc59f9f70dc94fac1c03d6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 8 Dec 2015 18:10:07 +0300 Subject: [PATCH] Avoid construction of empty live-ranges because of OP_DATA instruction --- Zend/zend_compile.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 1e38cafc89fb6..d304a6b28ed8a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1945,10 +1945,14 @@ static void zend_find_live_range(zend_op *opline, zend_uchar type, uint32_t var) static zend_always_inline int zend_is_def_range(zend_op *opline, zend_uchar type, uint32_t var) /* {{{ */ { - return opline->result_type == type && - opline->result.var == var && - opline->opcode != ZEND_ADD_ARRAY_ELEMENT && - opline->opcode != ZEND_ROPE_ADD; + if (opline->result_type == type && opline->result.var == var) { + return opline->opcode != ZEND_ADD_ARRAY_ELEMENT && + opline->opcode != ZEND_ROPE_ADD; + } else if (opline->opcode == ZEND_OP_DATA) { + return (opline-1)->result_type == type && + (opline-1)->result.var == var; + } + return 0; } /* }}} */