]> granicus.if.org Git - php/commitdiff
cleanup
authorDmitry Stogov <dmitry@zend.com>
Fri, 20 Nov 2015 22:19:45 +0000 (01:19 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 20 Nov 2015 22:19:45 +0000 (01:19 +0300)
ext/opcache/Optimizer/zend_cfg.c
ext/opcache/Optimizer/zend_cfg.h

index 3585bfe79445671d963fa43776d56037c441d135..374bf25e484830d0abb162a3c5f58973cee91067 100644 (file)
@@ -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;
index 7a847abf72aed6555908dfc69e7e92787e769841..76d1bb44ab32e1be1ecbbac905445bfc92f87082 100644 (file)
@@ -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;