1 - At RREMOVE also check the stack set aside for coercions.
authorkeie <none@none>
Fri, 1 Mar 1985 16:25:21 +0000 (16:25 +0000)
committerkeie <none@none>
Fri, 1 Mar 1985 16:25:21 +0000 (16:25 +0000)
2 - When coercions unexpectedly need stack of part of the
stakpattern, discontinue this option.

mach/proto/ncg/codegen.c

index 510dd91..fd11d80 100644 (file)
@@ -392,14 +392,14 @@ if(Debug>1) fprintf(stderr,"Next tuple %d,%d,%d,%d\n",
                ntup = tup->p_next;
                for (i=0,t=0;i<nregneeded && t<mincost; i++)
                        t += docoerc(regtp[i],regcp[i],ply,FALSE,tup->p_rar[i]);
-               if (t<mincost) {
+               if ( t<mincost && tokpatlen<=stackheight ) {
 #ifndef NDEBUG
                        if (Debug>2)
                                fprintf(stderr,"Continuing match after coercions\n");
 #endif
                        t += codegen(codep,ply,FALSE,mincost-t,0);
                }
-               if (t<mincost) {
+               if ( t<mincost && tokpatlen<=stackheight ) {
                        mincost = t;
                        besttup = tup;
                } else
@@ -480,6 +480,7 @@ normalfailed:       if (stackpad!=tokpatlen) {
        result=compute(&enodes[nodeno]);
        if (result.e_typ!=EV_REG)
                break;
+       if ( in_stack(result.e_v.e_reg) ) BROKE() ; /* Check aside-stack */
        for (tp= &fakestack[stackheight-tokpatlen-1];tp>=&fakestack[0];tp--)
                if (tp->t_token==-1) {
                        if(tp->t_att[0].ar==result.e_v.e_reg)