improved ply handling
This commit is contained in:
parent
5fbaff533c
commit
ed2ba2e1d5
1 changed files with 5 additions and 2 deletions
|
@ -148,6 +148,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++;
|
||||||
if (n==0) { /* "procedure" */
|
if (n==0) { /* "procedure" */
|
||||||
int j, nargs;
|
int j, nargs;
|
||||||
|
@ -853,8 +857,7 @@ normalfailed: if (stackpad!=tokpatlen) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!toplevel) {
|
if (!toplevel) {
|
||||||
if (ply >= j) ply = emrepllen + ply - j;
|
ply += emrepllen;
|
||||||
else ply = emrepllen;
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (Debug > 4)
|
if (Debug > 4)
|
||||||
fprintf(stderr, "ply becomes %d\n", ply);
|
fprintf(stderr, "ply becomes %d\n", ply);
|
||||||
|
|
Loading…
Add table
Reference in a new issue