ply adaption was wrong for EM replacements
authorceriel <none@none>
Thu, 17 Dec 1992 12:52:21 +0000 (12:52 +0000)
committerceriel <none@none>
Thu, 17 Dec 1992 12:52:21 +0000 (12:52 +0000)
mach/proto/cg/codegen.c
mach/proto/ncg/codegen.c

index b56fc7c..e763e08 100644 (file)
@@ -656,8 +656,10 @@ if (Debug > 1) fprintf(stderr, "cost after coercions: %u\n", t);
                        break;
                }
        }
-       if (!toplevel)
-               ply += emrepllen;
+       if (!toplevel) {
+               if (ply >= j) ply += emrepllen - j;
+               else ply = emrepllen;
+       }
        break;
     case DO_COST:
        DEBUG("COST");
index 61abf04..d73fc04 100644 (file)
@@ -852,8 +852,14 @@ normalfailed:      if (stackpad!=tokpatlen) {
                        break;
                }
        }
-       if (!toplevel)
-               ply += emrepllen;
+       if (!toplevel) {
+               if (ply >= j) ply = emrepllen + ply - j;
+               else ply = emrepllen;
+#ifndef NDEBUG
+               if (Debug > 4) 
+                       fprintf(stderr, "ply becomes %d\n", ply);
+#endif
+       }
        break;
     }
     case DO_COST: {