ply adaption was wrong for EM replacements

This commit is contained in:
ceriel 1992-12-17 12:52:21 +00:00
parent b1be3e3487
commit 4d068e8e04
2 changed files with 12 additions and 4 deletions

View file

@ -656,8 +656,10 @@ if (Debug > 1) fprintf(stderr, "cost after coercions: %u\n", t);
break;
}
}
if (!toplevel)
ply += emrepllen;
if (!toplevel) {
if (ply >= j) ply += emrepllen - j;
else ply = emrepllen;
}
break;
case DO_COST:
DEBUG("COST");

View file

@ -852,8 +852,14 @@ normalfailed: if (stackpad!=tokpatlen) {
break;
}
}
if (!toplevel)
ply += emrepllen;
if (!toplevel) {
if (ply >= j) ply = emrepllen + ply - j;
else ply = emrepllen;
#ifndef NDEBUG
if (Debug > 4)
fprintf(stderr, "ply becomes %d\n", ply);
#endif
}
break;
}
case DO_COST: {