[cfe-dev] assertion on initialized struct in non zero address space

Chris Lattner clattner at apple.com
Sun Jan 11 16:21:19 PST 2009


On Jan 9, 2009, at 9:55 AM, Alireza.Moshtaghi at microchip.com wrote:

> Consider :
>
> struct _st {
>  int var1;
>  int var2;
> } s __attribute ((address_space(1))) = {1, 1};
>
> When it gets to InitListChecker::CheckListElementTypes()
> DeclType->isStructureType() returns false and eventually the function
> asserts.
>
> How should we go about fixing this problem?

Hi Alireza,

This turned out to be some bugs in the type predicates.   
Type::isStructureType should look through ASQualTypes to see that the  
underlying type is a struct.  I fixed this and some other related bugs  
and checked in your testcase.

Thanks!

-Chris



More information about the cfe-dev mailing list