From ed2ba2e1d5f18e6412098a932abc875e416da356 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 18 Dec 1992 10:22:55 +0000 Subject: [PATCH] improved ply handling --- mach/proto/ncg/codegen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mach/proto/ncg/codegen.c b/mach/proto/ncg/codegen.c index d73fc04be..b244e99d6 100644 --- a/mach/proto/ncg/codegen.c +++ b/mach/proto/ncg/codegen.c @@ -148,6 +148,10 @@ unsigned codegen(codep,ply,toplevel,costlimit,forced) byte *codep; unsigned cost #ifndef NDEBUG chkregs(); #endif + if (! toplevel) { + ply -= emp-saveemp+1; + if (ply <= 0) ply = 1; + } n = *bp++; if (n==0) { /* "procedure" */ int j, nargs; @@ -853,8 +857,7 @@ normalfailed: if (stackpad!=tokpatlen) { } } if (!toplevel) { - if (ply >= j) ply = emrepllen + ply - j; - else ply = emrepllen; + ply += emrepllen; #ifndef NDEBUG if (Debug > 4) fprintf(stderr, "ply becomes %d\n", ply); -- 2.34.1