FIX: did not handle most of the 'end of basic block' instructions right;

many of them have effect on the stack, and this went by unnoticed
This commit is contained in:
ceriel 1988-09-07 09:20:37 +00:00
parent 612ddc8a4e
commit f78b282fb4

View file

@ -186,6 +186,34 @@ STATIC fiddle_stack(lnp)
dummy.tk_size = off_set(lnp); dummy.tk_size = off_set(lnp);
Push(&dummy); Push(&dummy);
break; break;
case op_beq:
case op_bge:
case op_bgt:
case op_bne:
case op_ble:
case op_blt:
Pop(&dummy, (offset) ws);
Pop(&dummy, (offset) ws);
break;
case op_bra:
case op_csa:/* ??? */
case op_csb:/* ??? */
case op_gto:/* ??? */
case op_ret:/* ??? */
case op_rtt:/* ??? */
break;
case op_zeq:
case op_zge:
case op_zgt:
case op_zne:
case op_zle:
case op_zlt:
case op_trp:
Pop(&dummy, (offset) ws);
break;
case op_rck:
Pop(&dummy, (offset) ps);
break;
} }
} }
@ -317,6 +345,7 @@ vnm(bp)
hopeless(INSTR(lnp)); hopeless(INSTR(lnp));
break; break;
case BBLOCK_END: case BBLOCK_END:
fiddle_stack(lnp);
break; break;
default: default:
assert(FALSE); assert(FALSE);