Bug fix: used field of freed struct

This commit is contained in:
ceriel 1991-10-25 14:27:59 +00:00
parent aab21f875e
commit 69026d6c17
2 changed files with 7 additions and 15 deletions

View file

@ -55,6 +55,8 @@
STATIC int Scj; /* number of optimizations found */
STATIC showinstr();
#define DLINK(l1,l2) l1->l_next=l2; l2->l_prev=l1
@ -200,9 +202,12 @@ STATIC jump_cross(l1,l2,b1,b2)
DLINK(l,l1);
}
b->b_start = l;
for (l = l2; INSTR(l) != op_bra; l = l->l_next) {
for (l = l2; INSTR(l) != op_bra;) {
line_p next = l->l_next;
assert (l != (line_p) 0);
rm_line(l,b2);
l = next;
}
INSTRLAB(l) = INSTRLAB(b->b_start);
}
@ -355,16 +360,3 @@ STATIC showinstr(lnp) line_p lnp; {
}
printf("\n");
} /* showinstr */
STATIC print_list(list,b1,b2,p)
line_p list;
bblock_p b1,b2;
proc_p p;
{
line_p l;
printf("block %d and %d of proc %d:\n",b1->b_id,b2->b_id,p->p_id);
for (l = list; l != 0; l = l->l_next) {
showinstr(l);
}
}

View file

@ -37,7 +37,7 @@ clean:
rm -f *.$(SUF) cj Out out nohup.out
lint:
$(LINT) $(LINTFLAGS) $(CFILES)
$(LINT) $(LINTFLAGS) $(CFILES) $(EMLIB)/ego/$(LINTPREF)share.$(LINTSUF) $(EMLIB)/$(LINTPREF)em_data.$(LINTSUF)
pr:
@pr $(PRFILES)