[antlr-interest] Re: ANTLR C++ problem on AIX?

Bryan Ewbank ewbank at gmail.com
Mon May 16 10:24:38 PDT 2005


Followup:

As Rosanne Rosanadana says:  "Oh...  Heh, heh.... Never Mind".

We've been bit by sequence points.  C++ defines operations only at
sequence points - more or less, at each ";" in the input - and
operation sequencing is undefined below that level.

One compiler was evaluating expression elements L-to-R ahead of time;
the other was evaluating them R-to-L.  Pulling the intermediate into a
separate statement ensured that (at the sequence point introduced) the
intermediate was defined.

I feel so silly for asking in the first place...

On 5/16/05, Bryan Ewbank <ewbank at gmail.com> wrote:
> When using C++ mode, has anyone else seen problems with xlC on AIX platforms?
> 
> We are getting segv's when a user-defined function that throws an
> exception is called from within a #() expression in a user-defined
> action; moving the function call out of the #() resolves/sidesteps the
> problem.
> 
> Thanks for any comments,
> - Bryan
> 
> What we are seeing:
> ---------
> platform: rs6k64-ibm-aix5.1 architecture
> compiler: xlC -- VisualAge C++ Professional / C for AIX Compiler, Version 6
> problem:  segv's; resolved by code rewrite...
> 
> // SEGVs happen when constructNode() throws an exception
> RefTreeNode expr = #( e, #( a, m, constructNode(v) ) );
> 
> // Moving the function that can throw errors out of the ANTLR construction
> // bypasses the problem
> RefTreeNode mv = constructNode(v);
> RefTreeNode expr = #( e, #( a, m, mv ) );
>


More information about the antlr-interest mailing list