#define DEBUG(string) {if(Debug) fprintf(stderr,"%-*d%s\n",4*level,level,string);}
#endif
-#define BROKE() {assert(origcp!=startupcode);DEBUG("BROKE");totalcost=INFINITY;goto doreturn;}
+#define BROKE() {assert(origcp!=startupcode || !paniced);DEBUG("BROKE");totalcost=INFINITY;goto doreturn;}
#define CHKCOST() {if (totalcost>=costlimit) BROKE();}
#ifdef TABLEDEBUG
if (dist<mindistance) {
if(dist==0)
goto gotit;
- if (! paniced) npos=0;
+ npos=0;
mindistance = dist;
}
#ifdef ALLOW_NEXTEM
myfree((string)besttup);
normalfailed: if (stackpad!=tokpatlen) {
if (stackpad) {
- if (costlimit<MAXINT)
- BROKE();
for (i=0;i<stackheight-stackpad;i++)
fakestack[i] = fakestack[i+stackpad];
stackheight -= stackpad;
+ if (costlimit<MAXINT)
+ BROKE();
totalcost += stackupto(&fakestack[stackheight-1],ply,toplevel);
} else
totalcost += stackupto(fakestack,ply,toplevel);
goto nextmatch;
}
totalcost += mincost;
+ for (i=0;i<stackheight-stackpad;i++)
+ fakestack[i] = fakestack[i+stackpad];
+ stackheight -= stackpad;
BROKE();
}
for (i=0;i<nregneeded;i++)