The "alignment" field of the array declaration is used by compound types
containing an array field to calculate the alignment needed for the
compound types.
Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
array_declaration->elem = elem_declaration;
array_declaration->scope = new_declaration_scope(parent_scope);
declaration->id = CTF_TYPE_ARRAY;
- /* No need to align the array, the first element will align itself */
- declaration->alignment = 1;
+ declaration->alignment = elem_declaration->alignment;
declaration->declaration_free = _array_declaration_free;
declaration->definition_new = _array_definition_new;
declaration->definition_free = _array_definition_free;