]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added work-arounds for MPW 3.{1,2?} code generation bug.
authorGuido van Rossum <guido@python.org>
Tue, 10 Sep 1991 14:53:39 +0000 (14:53 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 10 Sep 1991 14:53:39 +0000 (14:53 +0000)
Parser/acceler.c

index 33f91b66727bc2f85792dc7145154b3ce155c1e2..53fa12e69d630a725744c983859c023fde5d227f 100644 (file)
@@ -104,10 +104,27 @@ fixstate(g, d, s)
                        }
                        for (ibit = 0; ibit < g->g_ll.ll_nlabels; ibit++) {
                                if (testbit(d1->d_first, ibit)) {
+#ifdef applec
+#define MPW_881_bug                    /* Undefine if bug below is fixed */
+#endif
+#ifdef MPW_881_BUG
+                                       /* In 881 mode MPW 3.1 has a code
+                                          generation bug which seems to
+                                          set the upper bits; fix this by
+                                          explicitly masking them off */
+                                       int temp;
+#endif
                                        if (accel[ibit] != -1)
                                                printf("XXX ambiguity!\n");
+#ifdef MPW_881_BUG
+                                       temp = 0xFFFF &
+                                               (a->a_arrow | (1 << 7) |
+                                                ((type - NT_OFFSET) << 8));
+                                       accel[ibit] = temp;
+#else
                                        accel[ibit] = a->a_arrow | (1 << 7) |
                                                ((type - NT_OFFSET) << 8);
+#endif
                                }
                        }
                }