* gdbtypes.c (append_composite_type_field): Correct the location of

appended fields.
This commit is contained in:
Pedro Alves 2009-01-09 17:41:53 +00:00
parent 58d4abe16b
commit 87f707814c
2 changed files with 8 additions and 4 deletions

View file

@ -1856,10 +1856,9 @@ append_composite_type_field (struct type *t, char *name,
{
TYPE_LENGTH (t) = TYPE_LENGTH (t) + TYPE_LENGTH (field);
if (TYPE_NFIELDS (t) > 1)
{
FIELD_BITPOS (f[0]) = (FIELD_BITPOS (f[-1])
+ TYPE_LENGTH (field) * TARGET_CHAR_BIT);
}
FIELD_BITPOS (f[0]) = (FIELD_BITPOS (f[-1])
+ (TYPE_LENGTH (FIELD_TYPE (f[-1]))
* TARGET_CHAR_BIT));
}
}