diff options
| author | Xinchen Hui <laruence@php.net> | 2015-05-07 19:25:41 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2015-05-07 19:25:41 +0800 |
| commit | fbd1f1f282466bd709081e104d65baf597aee666 (patch) | |
| tree | e788c9c2b4a14b011c89e5498b3115b09213cdfa /ext | |
| parent | 460e2e6a04ebdd3914bbea449323187684532c84 (diff) | |
| parent | e5ea3f362c43694ea32244d4e76d5c23d1233017 (diff) | |
| download | php-git-fbd1f1f282466bd709081e104d65baf597aee666.tar.gz | |
Merge branch 'master' of git.php.net:php-src
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 16 | ||||
| -rw-r--r-- | ext/opcache/tests/bug695449.phpt | 18 |
2 files changed, 27 insertions, 7 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 1d92f123b8..4071043186 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1654,13 +1654,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 |
