fixed another bug with header blocks, and modified to use existing header

block when possible
This commit is contained in:
ceriel
1987-08-05 09:46:38 +00:00
parent ae4f6afd07
commit 8024d620cc
3 changed files with 62 additions and 12 deletions

View File

@@ -116,17 +116,25 @@ STATIC adjust_jump(newtarg,oldtarg,c)
* start of the new target.
*/
line_p l;
line_p l = last_instr(c);
assert(l != (line_p) 0);
if (INSTR(oldtarg->b_start) == op_lab) {
/* If old target has no label, it cannot be jumped to */
l = last_instr(c);
assert(l != (line_p) 0);
if (TYPE(l) == OPINSTRLAB &&
INSTRLAB(l) == INSTRLAB(oldtarg->b_start)) {
INSTRLAB(l) = label(newtarg);
}
}
if (c->b_next == oldtarg && INSTR(l) != op_bra) {
line_p new = newline(OPINSTRLAB);
INSTRLAB(new) = label(newtarg);
new->l_instr = op_bra;
DLINK(l, new);
}
}