From: ceriel Date: Wed, 8 Nov 1989 17:13:33 +0000 (+0000) Subject: fixed bug in EM replacement code, and use new #defines from tables.h X-Git-Tag: release-5-5~2093 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=339f9dd9423b256ab97ab08c866f45f1df2fdeba;p=ack.git fixed bug in EM replacement code, and use new #defines from tables.h --- 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