From 339f9dd9423b256ab97ab08c866f45f1df2fdeba Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 8 Nov 1989 17:13:33 +0000 Subject: [PATCH] fixed bug in EM replacement code, and use new #defines from tables.h --- mach/proto/ncg/codegen.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mach/proto/ncg/codegen.c b/mach/proto/ncg/codegen.c index 806faeb71..6e89de059 100644 --- a/mach/proto/ncg/codegen.c +++ b/mach/proto/ncg/codegen.c @@ -23,9 +23,6 @@ static char rcsid[] = "$Header$"; #define ALLOW_NEXTEM /* code generator is allowed new try of NEXTEM in exceptional cases */ -#define MAXPATTERN 5 -#define MAXREPLLEN 5 /* Max length of EM-replacement, should come from boot */ - byte startupcode[] = { DO_NEXTEM }; byte *nextem(); @@ -251,7 +248,7 @@ if (Debug) unsigned mincost,t; token_p tp; int size,lsize; - int tokexp[MAXPATTERN]; + int tokexp[MAXPATLEN]; int nregneeded; token_p regtp[MAXCREG]; c3_p regcp[MAXCREG]; @@ -779,7 +776,7 @@ normalfailed: if (stackpad!=tokpatlen) { register i; int j; int nodeno; - result_t result; + result_t result[MAXEMREPLLEN]; int emrepllen,eminstr; DEBUG("EMREPLACE"); @@ -797,8 +794,10 @@ normalfailed: if (stackpad!=tokpatlen) { getint(eminstr,codep); getint(nodeno,codep); emp[i].em_instr = eminstr; - result = compute(&enodes[nodeno]); - switch(result.e_typ) { + result[i] = compute(&enodes[nodeno]); + } + for (i=0;i