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;
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++;
}
}
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;
+------------+---+---+---+---+---+
*/
-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;