improved ply handling
This commit is contained in:
parent
ed2ba2e1d5
commit
d2fb022441
1 changed files with 5 additions and 2 deletions
|
@ -139,6 +139,10 @@ unsigned codegen(codep,ply,toplevel,costlimit,forced) byte *codep; unsigned cost
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
chkregs();
|
chkregs();
|
||||||
#endif
|
#endif
|
||||||
|
if (! toplevel) {
|
||||||
|
ply -= emp-saveemp+1;
|
||||||
|
if (ply <= 0) ply = 1;
|
||||||
|
}
|
||||||
n = *bp++;
|
n = *bp++;
|
||||||
assert(n>0 && n<=MAXRULE);
|
assert(n>0 && n<=MAXRULE);
|
||||||
if (n>1) {
|
if (n>1) {
|
||||||
|
@ -657,8 +661,7 @@ if (Debug > 1) fprintf(stderr, "cost after coercions: %u\n", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!toplevel) {
|
if (!toplevel) {
|
||||||
if (ply >= j) ply += emrepllen - j;
|
ply += emrepllen;
|
||||||
else ply = emrepllen;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DO_COST:
|
case DO_COST:
|
||||||
|
|
Loading…
Reference in a new issue