resend patch: yet another macro expansion bug (cpplib)

Dave Brolley brolley@cygnus.com
Tue Oct 6 09:40:00 GMT 1998


Right....I recall approving this.

Dave

Zack Weinberg wrote:

> This patch appears to have gotten lost.  It was approved conditional
> on another patch which has been applied.
>
> zw
>
> 1998-10-02 19:59 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
>
>         * cpplib.c (macroexpand): Correct off-by-one error in handling
>         of escapes [fixes c-torture/compile/981001-4.c].
>
> --- cpplib.c.bug1       Fri Oct  2 19:53:10 1998
> +++ cpplib.c    Fri Oct  2 19:58:09 1998
> @@ -2888,8 +2888,8 @@
>                           /* If whitespace is preceded by an odd number
>                              of `@' signs, the last `@' was a whitespace
>                              marker; drop it too. */
> -                         while (p2 != p1 && p2[-1] == '@') p2--;
> -                         if ((l1 - 1 - p2) & 1)
> +                         while (p2 != p1 && p2[0] == '@') p2--;
> +                         if ((l1 - p2) & 1)
>                             l1--;
>                           break;
>                         }
> @@ -2899,8 +2899,8 @@
>                           /* If a `-' is preceded by an odd number of
>                              `@' signs then it and the last `@' are
>                              a no-reexpansion marker.  */
> -                         while (p2 != p1 && p2[-1] == '@') p2--;
> -                         if ((l1 - 1 - p2) & 1)
> +                         while (p2 != p1 && p2[0] == '@') p2--;
> +                         if ((l1 - p2) & 1)
>                             l1 -= 2;
>                           else
>                             break;






More information about the Gcc-patches mailing list