[antlr-interest] SEGV when running AST builder in C target, antlr3.0
Hardy, Stephen
Stephen_Hardy at rabbit.com
Tue Jul 3 16:30:06 PDT 2007
Jim,
I'm hacking the source to work around it. Seems that testing for "-1"
as well as null is working, but there are several more places to get
through.
It's not really a complex problem; it happens right away.
Anyway, don't worry about it for now - go have that beer...
Regards,
SJH
> -----Original Message-----
> From: Jim Idle [mailto:jimi at temporal-wave.com]
> Sent: Tuesday, July 03, 2007 4:24 PM
> To: Hardy, Stephen; antlr-interest at antlr.org
> Subject: RE: [antlr-interest] SEGV when running AST builder
> in C target, antlr3.0
>
> 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