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
This commit is contained in:
parent
ededd15b74
commit
16ef0467a8
2 changed files with 9 additions and 1 deletions
|
@ -152,7 +152,7 @@ unsigned codegen(codep,ply,toplevel,costlimit,forced) byte *codep; unsigned cost
|
||||||
int j, nargs;
|
int j, nargs;
|
||||||
getint(i,bp);
|
getint(i,bp);
|
||||||
getint(nargs,bp);
|
getint(nargs,bp);
|
||||||
assert(nargs < MAXPROCARG);
|
assert(nargs <= MAXPROCARG);
|
||||||
for (j = 0; j < nargs; j++) {
|
for (j = 0; j < nargs; j++) {
|
||||||
getint(procarg[j],bp);
|
getint(procarg[j],bp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,6 +324,14 @@ distance(cindex) {
|
||||||
return(100);
|
return(100);
|
||||||
if (expsize<toksize)
|
if (expsize<toksize)
|
||||||
return(99-i);
|
return(99-i);
|
||||||
|
|
||||||
|
/* Now we have a match in size, but it is not exact.
|
||||||
|
Therefore, make sure that we can at least
|
||||||
|
create it from the stack!
|
||||||
|
*/
|
||||||
|
if (! from_stack(&machsets[tokexp])) {
|
||||||
|
return MAXINT;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
exact++;
|
exact++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue