com php-src: cleanup: ext/opcache/Optimizer/zend_cfg.c ex t/opcache/Optimizer/zend_cfg.h
| From: | Dmitry Stogov | Date: | Fri, 20 Nov 2015 22:19:45 +0000 |
| Subject: | com php-src: cleanup: ext/opcache/Optimizer/zend_cfg.c ex t/opcache/Optimizer/zend_cfg.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89944@lists.php.net to get a copy of this message | ||
Commit: 4d49736155eaa1696b2ede40f6e3440480d83e6f
Author: Dmitry Stogov <dmitry@zend.com> Sat, 21 Nov 2015 01:19:45 +0300
Parents: 02fad0414b3cae4699028e268bc663eab1f5a6cd
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4d49736155eaa1696b2ede40f6e3440480d83e6f
Log:
cleanup
Changed paths:
M ext/opcache/Optimizer/zend_cfg.c
M ext/opcache/Optimizer/zend_cfg.h
Diff:
diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c
index 3585bfe..374bf25 100644
--- a/ext/opcache/Optimizer/zend_cfg.c
+++ b/ext/opcache/Optimizer/zend_cfg.c
@@ -539,6 +539,9 @@ int zend_cfg_build_predecessors(zend_arena **arena, zend_cfg *cfg) /* {{{ */
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;
b->successors[1] = -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 7a847ab..76d1bb4 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;