]> granicus.if.org Git - php/commitdiff
Order live ranges according to "start" position
authorDmitry Stogov <dmitry@zend.com>
Mon, 14 Aug 2017 09:21:07 +0000 (12:21 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 14 Aug 2017 09:21:07 +0000 (12:21 +0300)
Zend/tests/temporary_cleaning_016.phpt [new file with mode: 0644]
Zend/zend_compile.c

diff --git a/Zend/tests/temporary_cleaning_016.phpt b/Zend/tests/temporary_cleaning_016.phpt
new file mode 100644 (file)
index 0000000..40d8658
--- /dev/null
@@ -0,0 +1,17 @@
+--TEST--
+Live ranges should be ordered according to "start" position
+--FILE--
+<?php
+set_error_handler(function($no, $msg) { throw new Exception; });
+
+try {
+    $a = [];
+    $str = "$a${"y$a$a"}y";
+} catch (Exception $e) {
+    echo "Exception\n";
+}
+?>
+DONE
+--EXPECT--
+DONE
+
index e1d7b899b7497214538155ffe7ee0746e1cbb0f5..0772bc4f1e94b1da6dc63ebbfe3f54f840042cca 100644 (file)
@@ -7844,7 +7844,7 @@ static void zend_compile_encaps_list(znode *result, zend_ast *ast) /* {{{ */
                GET_NODE(result, opline->result);
        } else {
                uint32_t var;
-               uint32_t range = zend_start_live_range(CG(active_op_array), rope_init_lineno);
+               uint32_t range = zend_start_live_range_ex(CG(active_op_array), rope_init_lineno);
 
                init_opline->extended_value = j;
                opline->opcode = ZEND_ROPE_END;