some more fixes

This commit is contained in:
ceriel 1987-09-14 12:41:08 +00:00
parent 74c758e503
commit 8d2afe1103
2 changed files with 26 additions and 24 deletions

View file

@ -1 +1 @@
static char Version[] = "ACK Modula-2 compiler Version 0.16"; static char Version[] = "ACK Modula-2 compiler Version 0.17";

View file

@ -532,32 +532,34 @@ WalkStat(nd, exit_label)
C_stl(tmp); C_stl(tmp);
nd->nd_def->df_flags |= D_FORLOOP; nd->nd_def->df_flags |= D_FORLOOP;
C_df_ilb(l1); C_df_ilb(l1);
} if (! options['R']) {
if (! options['R']) { tmp2 = NewInt();
tmp2 = NewInt(); ForLoopVarExpr(nd);
ForLoopVarExpr(nd); C_stl(tmp2);
C_stl(tmp2); }
} }
WalkNode(right, exit_label); WalkNode(right, exit_label);
if (! options['R']) {
C_lol(tmp2);
ForLoopVarExpr(nd);
C_cal("_forloopchk");
FreeInt(tmp2);
}
nd->nd_def->df_flags &= ~D_FORLOOP; nd->nd_def->df_flags &= ~D_FORLOOP;
if (good_forvar && stepsize) { if (good_forvar) {
C_lol(tmp); if (! options['R']) {
C_zeq(l2); C_lol(tmp2);
C_lol(tmp); ForLoopVarExpr(nd);
C_loc((arith) 1); C_cal("_forloopchk");
C_sbu(int_size); FreeInt(tmp2);
C_stl(tmp); }
C_loc(left->nd_INT); if (stepsize) {
ForLoopVarExpr(nd); C_lol(tmp);
C_adu(int_size); C_zeq(l2);
RangeCheck(nd->nd_type, bstp); C_lol(tmp);
CodeDStore(nd); C_loc((arith) 1);
C_sbu(int_size);
C_stl(tmp);
C_loc(left->nd_INT);
ForLoopVarExpr(nd);
C_adu(int_size);
RangeCheck(nd->nd_type, bstp);
CodeDStore(nd);
}
} }
C_bra(l1); C_bra(l1);
C_df_ilb(l2); C_df_ilb(l2);