[cfe-dev] How to get expressions hiding in types?

Chris Lattner clattner at apple.com
Sat Apr 18 22:14:09 PDT 2009


On Apr 18, 2009, at 10:11 PM, Eli Friedman wrote:

> On Sat, Apr 18, 2009 at 10:05 PM, Chris Lattner <clattner at apple.com>  
> wrote:
>>
>> On Apr 18, 2009, at 9:57 PM, Eli Friedman wrote:
>>
>>> On Sat, Apr 18, 2009 at 4:10 PM, Chris Lattner  
>>> <clattner at apple.com> wrote:
>>>>
>>>> How do I find expressions hiding in the vla sizes of types?  I see
>>>> that the stmt dumper doesn't walk into them with child iterators  
>>>> either.
>>>>
>>>> I need this to implement checks for these cases:
>>>>
>>>> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090413/015827.html
>>>
>>> The problem isn't limited to VLAs... consider something like
>>> "L:;static int a[1 || ({goto L; 0})];".
>>
>> Ok, what even happens to that expression?  Do we just drop it on  
>> the floor?
>
> Yes; the type of the array gets "fixed" to int[1], so there isn't any
> place to keep the expression.

Gross.  GCC allows gotos within statement expressions, just not out of  
them.  We'd need to do something akin to jump tracking just to detect  
this case.

-Chris



More information about the cfe-dev mailing list