[antlr-interest] SEGV when running AST builder in C target, antlr3.0

Jim Idle jimi at temporal-wave.com
Tue Jul 3 16:23:37 PDT 2007


Not seen that issue and I have some pretty complicated tree building
parsers. However this may be related to a a fix made by a recent change
to ensure that pointers are initialized to NULL at rule starts. Perhaps
that also needs to be assured for the AST.stg too. The changes to ATS
building were a bit close to the release day for comfort really ;-).

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Hardy, Stephen
> Sent: Tuesday, July 03, 2007 4:11 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] SEGV when running AST builder in C target,
> antlr3.0
> 
> Jim,
> 
> when adding output=AST stuff to the C grammar, the runtime library
gets
> a seg fault in becomeRoot().  The main problem seems to be that the
> code
> tests pointers for NULL, whereas the pointers are actually getting
> small
> negative numbers because of various consitions in the token stream
> (such
> as empty).  Probably, there needs to be a macro like
> IS_NOT_A_POINTER_OR_IS_NULL(newRootTree) etc.
> 
> Regards,
> SJH


More information about the antlr-interest mailing list