diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 16 | ||||
-rw-r--r-- | ext/opcache/tests/bug695449.phpt | 18 |
3 files changed, 31 insertions, 7 deletions
@@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #69566 (Conditional jump or move depends on uninitialised value in extension trait). (jbboehr at gmail dot com) +- Opcache + . Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF). + (Laruence, Dmitry) + 14 May 2015, PHP 5.5.25 - Core: diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index bbdddec750..d0e3ddfa82 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1759,13 +1759,15 @@ next_target_ex: } } else if (block->op2_to == block->ext_to) { /* both goto the same one - it's JMP */ - /* JMPZNZ(?,L,L) -> JMP(L) */ - last_op->opcode = ZEND_JMP; - SET_UNUSED(last_op->op1); - SET_UNUSED(last_op->op2); - block->op1_to = block->op2_to; - block->op2_to = NULL; - block->ext_to = NULL; + if (!(last_op->op1_type & (IS_VAR|IS_TMP_VAR))) { + /* JMPZNZ(?,L,L) -> JMP(L) */ + last_op->opcode = ZEND_JMP; + SET_UNUSED(last_op->op1); + SET_UNUSED(last_op->op2); + block->op1_to = block->op2_to; + block->op2_to = NULL; + block->ext_to = NULL; + } } else if (block->op2_to == next) { /* jumping to next on Z - can follow to it and jump only on NZ */ /* JMPZNZ(X,L1,L2) L1: -> JMPNZ(X,L2) */ diff --git a/ext/opcache/tests/bug695449.phpt b/ext/opcache/tests/bug695449.phpt new file mode 100644 index 0000000000..53a143a229 --- /dev/null +++ b/ext/opcache/tests/bug695449.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +$a = array(true); +if($a[0] && false) { + echo 'test'; +} +echo "ok\n"; +?> +--EXPECT-- +ok |