diff options
author | Nikita Popov <nikic@php.net> | 2016-05-04 23:52:42 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-05-05 00:00:56 +0200 |
commit | 0691e7a8e15ace3ce186ceb8c27753325a5a956f (patch) | |
tree | 5f9d82ff7593d28f7bd5838285ad6312912e7e60 /ext | |
parent | 9af0c96af4ded5ac0935e6cc1a2fa253ce77dfac (diff) | |
download | php-git-0691e7a8e15ace3ce186ceb8c27753325a5a956f.tar.gz |
Fix JMPZ, JMPZNZ_EX chain optimization
The result_type was not copied, resulting in a corrupted JMPZ_EX.
Fix can be verified by inspecting the opcodes of the following
function (it should not contain any _EX opcodes):
function test() {
if ($a && $b) {
echo "a";
}
if ($b || $c || $d) {
echo "b";
}
}
Conflicts:
ext/opcache/Optimizer/block_pass.c
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index e168457661..5e9b20d191 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1471,9 +1471,9 @@ next_target: same_var == VAR_NUM_EX(target->op1) && target_block->follow_to && !target_block->protected) { - /* JMPZ(X, L), L: X = JMPNZ_EX(X, L2) -> JMPZ(X, L+1) */ + /* JMPZ(X, L), L: T = JMPNZ_EX(X, L2) -> T = JMPZ_EX(X, L+1) */ last_op->opcode += 3; - last_op->result = target->result; + COPY_NODE(last_op->result, target->result); del_source(block, block->op2_to); block->op2_to = target_block->follow_to; ADD_SOURCE(block, block->op2_to); |