Fix unaligned memory access

Bug found on sparc64. Thanks to "Jan Engelhardt <jengelh@medozas.de>"
for providing access to such a machine.
This commit is contained in:
Gustavo Sverzut Barbieri 2011-12-21 18:23:58 -02:00 committed by Lucas De Marchi
parent 9faa7b376c
commit c6824b62f2

View File

@ -669,7 +669,7 @@ static struct index_mm_node *index_mm_read_node(struct index_mm *idx,
child_count = 0;
}
children_padding = (offsetof(struct index_mm_node, children) +
children_padding = (sizeof(struct index_mm_node) +
(sizeof(uint32_t) * child_count)) % sizeof(void *);
if (offset & INDEX_NODE_VALUES)