]> granicus.if.org Git - php/commitdiff
Avoid construction of empty live-ranges because of OP_DATA instruction
authorDmitry Stogov <dmitry@zend.com>
Tue, 8 Dec 2015 15:10:07 +0000 (18:10 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 8 Dec 2015 15:10:07 +0000 (18:10 +0300)
Zend/zend_compile.c

index 1e38cafc89fb68a0639c27fb89bf1317f3e1977a..d304a6b28ed8ad99db2aaa7b1c3fb36c1fd08569 100644 (file)
@@ -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;
 }
 /* }}} */