From d4fb901288ad8aae45dd3096b59c05f671d6c3d9 Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 4 Apr 1990 14:52:29 +0000 Subject: [PATCH] Fixed wrong assertion, and fixed bug in distance routine: it did not check that each stackpattern token that does not exactly match can be made from the stack --- mach/proto/ncg/codegen.c | 2 +- mach/proto/ncg/subr.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mach/proto/ncg/codegen.c b/mach/proto/ncg/codegen.c index 0e54d1e6..e7c64ef1 100644 --- a/mach/proto/ncg/codegen.c +++ b/mach/proto/ncg/codegen.c @@ -152,7 +152,7 @@ unsigned codegen(codep,ply,toplevel,costlimit,forced) byte *codep; unsigned cost int j, nargs; getint(i,bp); getint(nargs,bp); - assert(nargs < MAXPROCARG); + assert(nargs <= MAXPROCARG); for (j = 0; j < nargs; j++) { getint(procarg[j],bp); } diff --git a/mach/proto/ncg/subr.c b/mach/proto/ncg/subr.c index e5f6cca0..c25cb0ba 100644 --- a/mach/proto/ncg/subr.c +++ b/mach/proto/ncg/subr.c @@ -324,6 +324,14 @@ distance(cindex) { return(100); if (expsize