From 16ef0467a8919b7df4957718e3dcca48754c08ff 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 0e54d1e6c..e7c64ef15 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 e5f6cca0a..c25cb0ba5 100644 --- a/mach/proto/ncg/subr.c +++ b/mach/proto/ncg/subr.c @@ -324,6 +324,14 @@ distance(cindex) { return(100); if (expsize