bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNU Bison 1.875] testsuite: 34 failed


From: Paul Eggert
Subject: Re: [GNU Bison 1.875] testsuite: 34 failed
Date: 03 Mar 2003 15:57:40 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

Thanks for the details.  Can you please try the following patch?  It
has already been installed into Bison CVS, so if it fixes your bug
then we can consider the case closed.

2003-03-01  Paul Eggert  <address@hidden>

        * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
        not loc->end, since loc->end might contain garbage and this leads
        to undefined behavior on some platforms.
        (id_loc, token_start): Use (IF_LINTed) initial values that do not
        depend on *loc, so that the reader doesn't give the the false
        impression that *loc is initialized.
        (<INITIAL>"%%"): Do not bother setting code_start, since its value
        does not survive the return.

2003-03-01  Akim Demaille  <address@hidden>

        * src/scan-gram.l (code_start): Always initialize it when entering
        into yylex, as SC_EPILOGUE is activated *before* the corresponding
        yylex invocation.  An alternative would be making it static, but
        then it starts with the second %%'s beginning, instead of its end.

--- scan-gram.l 3 Feb 2003 15:35:57 -0000       1.55
+++ scan-gram.l 2 Mar 2003 06:55:15 -0000       1.57
@@ -136,14 +136,16 @@ splice     (\\[ \f\t\v]*\n)*
   int token_type IF_LINT (= 0);
 
   /* Location of most recent identifier, when applicable.  */
-  location id_loc IF_LINT (= *loc);
+  location id_loc IF_LINT (= empty_location);
 
-  /* Where containing code started, when applicable.  */
-  boundary code_start IF_LINT (= loc->start);
+  /* Where containing code started, when applicable.  Its initial
+     value is relevant only when yylex is invoked in the SC_EPILOGUE
+     start condition.  */
+  boundary code_start = scanner_cursor;
 
   /* Where containing comment or string or character literal started,
      when applicable.  */
-  boundary token_start IF_LINT (= loc->start);
+  boundary token_start IF_LINT (= scanner_cursor);
 %}
 
 
@@ -270,10 +272,7 @@ splice      (\\[ \f\t\v]*\n)*
   "%%" {
     static int percent_percent_count;
     if (++percent_percent_count == 2)
-      {
-       code_start = loc->start;
-       BEGIN SC_EPILOGUE;
-      }
+      BEGIN SC_EPILOGUE;
     return PERCENT_PERCENT;
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]