bison-patches
[Top][All Lists]
Advanced

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

Re: FYI: code_start is not initialized for epilogue


From: Akim Demaille
Subject: Re: FYI: code_start is not initialized for epilogue
Date: Mon, 03 Mar 2003 12:04:06 +0100
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2

| Akim, thanks for spotting that bug. 

Well, valgrind is the real guy :)

| --- scan-gram.l.~1.56.~       2003-03-01 02:55:31.000000000 -0800
| +++ scan-gram.l       2003-03-01 22:43:48.048573000 -0800
| @@ -136,15 +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.
| -     Once the second %% seen, we are looking for the epilogue.  */
| -  boundary code_start = loc->end;
| +  /* 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;

Actually, this patch meant to be on top of the other issue.  It is not
clear to me that we need both scanner_cursor and yylloc.

  
|    /* 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);
|  %}
|  
|  
| @@ -271,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;
|    }

Of course, thanks.




reply via email to

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