Fixed flexible array struct members.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4131 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-09-08 07:55:44 +00:00
parent 9f7ca16001
commit 331803126f

View file

@ -723,8 +723,8 @@ static SymEntry* ParseStructDecl (const char* Name)
} }
/* Add a field entry to the table */ /* Add a field entry to the table */
if (FieldWidth > 0) { if (FieldWidth > 0) {
/* Add full byte from the bit offset to the variable offset. /* Add full byte from the bit offset to the variable offset.
* This simplifies handling he bit-field as a char type * This simplifies handling he bit-field as a char type
* in expressions. * in expressions.
*/ */
@ -738,7 +738,9 @@ static SymEntry* ParseStructDecl (const char* Name)
} }
} else { } else {
AddLocalSym (Decl.Ident, Decl.Type, SC_STRUCTFIELD, StructSize); AddLocalSym (Decl.Ident, Decl.Type, SC_STRUCTFIELD, StructSize);
StructSize += CheckedSizeOf (Decl.Type); if (!FlexibleMember) {
StructSize += CheckedSizeOf (Decl.Type);
}
} }
NextMember: if (CurTok.Tok != TOK_COMMA) { NextMember: if (CurTok.Tok != TOK_COMMA) {