From: Dmitry Stogov Date: Fri, 20 Nov 2015 22:19:45 +0000 (+0300) Subject: cleanup X-Git-Tag: php-7.1.0alpha1~705^2~55^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d49736155eaa1696b2ede40f6e3440480d83e6f;p=php cleanup --- diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c index 3585bfe794..374bf25e48 100644 --- a/ext/opcache/Optimizer/zend_cfg.c +++ b/ext/opcache/Optimizer/zend_cfg.c @@ -538,6 +538,9 @@ int zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /* {{{ */ int *predecessors; edges = 0; + for (b = blocks; b < end; b++) { + b->predecessors_count = 0; + } for (b = blocks; b < end; b++) { if (!(b->flags & ZEND_BB_REACHABLE)) { b->successors[0] = -1; @@ -547,7 +550,7 @@ int zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /* {{{ */ if (b->successors[0] >= 0) { edges++; blocks[b->successors[0]].predecessors_count++; - if (b->successors[0] >= 0) { + if (b->successors[1] >= 0) { edges++; blocks[b->successors[1]].predecessors_count++; } @@ -571,7 +574,7 @@ int zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /* {{{ */ } for (j = 0; j < cfg->blocks_count; j++) { - if ((blocks[j].flags & ZEND_BB_REACHABLE)) { + if (blocks[j].flags & ZEND_BB_REACHABLE) { if (blocks[j].successors[0] >= 0) { zend_basic_block *b = blocks + blocks[j].successors[0]; predecessors[b->predecessor_offset + b->predecessors_count] = j; diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h index 7a847abf72..76d1bb44ab 100644 --- a/ext/opcache/Optimizer/zend_cfg.h +++ b/ext/opcache/Optimizer/zend_cfg.h @@ -85,7 +85,7 @@ typedef struct _zend_basic_block { +------------+---+---+---+---+---+ */ -typedef struct _zend_jit_cfg { +typedef struct _zend_cfg { int blocks_count; /* number of basic blocks */ zend_basic_block *blocks; /* array of basic blocks */ int *predecessors;