[antlr-interest] C++ Crash in consumeUntil()

Christian Hoffmann Sanus at gmx.de
Sat May 20 10:29:10 PDT 2006


Hi,

in January Andrew Bell wrote about a possible Bug in ANTLR/C++-Runtime when throwing a SemanticException in a parser action.


> I am throwing a SemanticException in a parser action. It gets caught 
> by the default handler which catches the exception as a 
> RecognitionException. The exception handler calls reportError() and 
> then dies when it calls recover().
> Anyway, the problem seems to be that recover(), calls consume() 
> without regard to whether there is anything to consume. This 
> condition would be caught by the assert clause in 
> CircularQueue::removeItems() in debug mode, but the assert is a NOOP 
> if not build with debug. 

Try removing the assert does not fix the problem. Then, the code crashes a few lines later.
Is there any chance to solve the problem?

Thanks in advance,

Christian 




More information about the antlr-interest mailing list