com php-src: Fixed bug #69549 (Memory leak with opcache.optim ization_level=0xFFFFFFFF): NEWS ext/opcache/Optim izer/block_pass.c
ext/opcache/tests/bug695449 .phpt

From: Date: Thu, 07 May 2015 09:14:14 +0000
Subject: com php-src: Fixed bug #69549 (Memory leak with opcache.optim ization_level=0xFFFFFFFF): NEWS ext/opcache/Optim izer/block_pass.c
ext/opcache/tests/bug695449 .phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86639@lists.php.net to get a copy of this message
Commit: 8026001943109dea3f908b8dd0720a0de9781af6 Author: Dmitry Stogov <dmitry@zend.com> Thu, 7 May 2015 12:14:14 +0300 Parents: 33e2aa452d5b1c46e7b362450233a9fd84036cc9 Branches: PHP-5.5 PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8026001943109dea3f908b8dd0720a0de9781af6 Log: Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF) Bugs: https://bugs.php.net/69549 Changed paths: M NEWS M ext/opcache/Optimizer/block_pass.c A ext/opcache/tests/bug695449.phpt Diff: diff --git a/NEWS b/NEWS index 41f37f4..2e0b8b1 100644 --- a/NEWS +++ b/NEWS @@ -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 bbdddec..d0e3ddfa 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 0000000..53a143a --- /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

« previous php.cvs (#86639) next »