com php-src: Fixed other issues with empty block handling: ext/opcache/Optimizer/block_pass.c

From: Date: Wed, 09 Dec 2015 07:58:42 +0000
Subject: com php-src: Fixed other issues with empty block handling: ext/opcache/Optimizer/block_pass.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90161@lists.php.net to get a copy of this message
Commit: 44c5fbbc0724c53e055c7ba6febfaaf241ac4095 Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Dec 2015 10:58:42 +0300 Parents: 13096a8120fe845691dc5f8cbe17dd0572cc19c4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=44c5fbbc0724c53e055c7ba6febfaaf241ac4095 Log: Fixed other issues with empty block handling Changed paths: M ext/opcache/Optimizer/block_pass.c Diff: diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 0f083ba..2e797d4 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -776,7 +776,11 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) if (next < end && next == blocks + b->successors[0]) { /* JMP to the next block - strip it */ MAKE_NOP(opline); - b->end--; + if (b->end == 0) { + b->start++; + } else { + b->end--; + } } } else if (b->start == b->end && opline->opcode == ZEND_NOP) { /* skip empty block */ @@ -822,7 +826,7 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) op_array->last = len; for (b = blocks; b < end; b++) { - if (!(b->flags & ZEND_BB_REACHABLE)) { + if (!(b->flags & ZEND_BB_REACHABLE) || b->start > b->end) { continue; } opline = op_array->opcodes + b->end;

« previous php.cvs (#90161) next »