bison-patches
[Top][All Lists]
Advanced

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

%destructor can leak the lookahead


From: Akim Demaille
Subject: %destructor can leak the lookahead
Date: Thu, 02 Sep 2004 16:23:34 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

There is one case where %destructor is not triggered, but it should:
when the error recovery just aborts when we were popping the stack and
we reach its bottom.

One way to fix this leak is to just add a destructor call right
there.  Another would be to put this destructor call into yyabortlab.
That would imply:

- yydestruct can be called on EOF
  So what?  It should not be defined, and if the user meant to define
  it, there could be good reasons.

- yydestruct is called on the lookahead if the user explicitly calls
  YYABORT.

Because of this last reason, I'm tempted to release the lookahead at
yyerrorlab.

What do you think?




reply via email to

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