diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-16 20:31:01 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-16 20:31:01 +0100 |
commit | 07ad75ca9603b8b0195ddcd90229ae9dbe650900 (patch) | |
tree | 572e746bd8e160a0c4bf551bcc2d074c4a89f41b | |
parent | a5e532f729b1d5c4c05f10fdeef7e7e6dff1bae8 (diff) | |
parent | 0674d677bc82d448395f57e5612fc7280a2f5846 (diff) | |
download | php-git-07ad75ca9603b8b0195ddcd90229ae9dbe650900.tar.gz |
Merge branch 'PHP-7.2'
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 9 | ||||
-rw-r--r-- | ext/opcache/tests/bug75969.phpt | 24 |
2 files changed, 31 insertions, 2 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 9c0fd96471..97e44fe0b2 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -871,8 +871,6 @@ optimize_const_unary_op: } opline++; } - - strip_nops(op_array, block); } /* Rebuild plain (optimized) op_array from CFG */ @@ -1927,6 +1925,13 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx) zend_optimize_block(b, op_array, usage, &cfg, Tsource); } + /* Eliminate NOPs */ + for (b = blocks; b < end; b++) { + if (b->flags & ZEND_BB_REACHABLE) { + strip_nops(op_array, b); + } + } + /* Jump optimization for each block */ for (b = blocks; b < end; b++) { if (b->flags & ZEND_BB_REACHABLE) { diff --git a/ext/opcache/tests/bug75969.phpt b/ext/opcache/tests/bug75969.phpt new file mode 100644 index 0000000000..733ab2f9b7 --- /dev/null +++ b/ext/opcache/tests/bug75969.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #75969: Assertion failure in live range DCE due to block pass misoptimization +--INI-- +opcache.enable_cli=1 +opcache.optimization_level=-1 +--FILE-- +<?php + +// This is required for the segfault +md5('foo'); + +class Extended_Class {}; +$response = array( + 'a' => 'b' +); +new Extended_Class( array( + 'foo' => $response, + 'foo2' => 'bar2' +) ); + +?> +===DONE=== +--EXPECT-- +===DONE=== |