[antlr-interest] C runtime: crash in dupNode; UP/DOWN/etc. missing factory?

Jim Idle jimi at temporal-wave.com
Mon Jun 1 09:13:03 PDT 2009


Ned Gill wrote:
> On Mon, 01 Jun 2009 16:01:19 +0100, Ned Gill <thomas.gill at csr.com> wrote:
>
>> I believe the node it's trying to duplicate is one of
>> stream->UP/DOWN/EOF_NODE/INVALID_NODE initialised in
>> antlr3CommonTreeNodeStreamNew (in antlr3commontreenodestream.c). It 
>> looks
>> like those nodes never have their factory set. Is is safe to create a 
>> new
>> factory there just for those nodes? Is there a better fix I should
>> consider?
>
> I've fixed it by using the arboretum from stream->adaptor. Diff 
> attached. I've no idea whether this is generally safe, or a good idea 
> :) Comments welcome.
>
See previous reply. I will fix the runtime in the next release so that 
it does not fall over when trying to dup UP/DOWN/etc. Installing the 
tree factory from the adaptor may work, but I will have to trace it all out.

Jim


More information about the antlr-interest mailing list