bug fixed in last_mnem(): test on nil-pointer.
bug fixed in try_tail(): add line "if(l1==0||l2==0) return FALSE".
This commit is contained in:
parent
f487f26e00
commit
5a95c31414
1 changed files with 4 additions and 1 deletions
|
@ -83,7 +83,9 @@ STATIC line_p last_mnem(b)
|
||||||
register line_p l;
|
register line_p l;
|
||||||
|
|
||||||
for (l = b->b_start; l->l_next != (line_p) 0; l = l->l_next);
|
for (l = b->b_start; l->l_next != (line_p) 0; l = l->l_next);
|
||||||
while (INSTR(l) < sp_fmnem || INSTR(l) > sp_lmnem) l = PREV(l);
|
while (l != (line_p) 0 && (INSTR(l) < sp_fmnem || INSTR(l) > sp_lmnem)) {
|
||||||
|
l = PREV(l);
|
||||||
|
}
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +207,7 @@ STATIC bool try_tail(b1,b2)
|
||||||
if (b1->b_start == (line_p) 0 || b2->b_start == (line_p) 0) return FALSE;
|
if (b1->b_start == (line_p) 0 || b2->b_start == (line_p) 0) return FALSE;
|
||||||
l1 = last_mnem(b1);
|
l1 = last_mnem(b1);
|
||||||
l2 = last_mnem(b2);
|
l2 = last_mnem(b2);
|
||||||
|
if (l1 == (line_p) 0 || l2 == (line_p) 0) return FALSE;
|
||||||
/* printf("consider:\n"); showinstr(l1); showinstr(l2); */
|
/* printf("consider:\n"); showinstr(l1); showinstr(l2); */
|
||||||
if (INSTR(l1) == op_bra) {
|
if (INSTR(l1) == op_bra) {
|
||||||
b = b1;
|
b = b1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue