harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 787ef05e155dc59a116c79d3817e55857974e2d4
parent d130aed8fc7654271e1478e7085136fb8074c004
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 22 Aug 2021 20:17:19 +0200

gen: fix padding in tagged data items

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/gen.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -3038,6 +3038,12 @@ gen_data_item(struct gen_context *ctx, struct expression *expr, case STORAGE_TAGGED: item->type = QD_VALUE; item->value = constw((uint32_t)constant->tagged.tag->id); + if (type->align != builtin_type_uint.align) { + item->next = xcalloc(1, sizeof(struct qbe_data_item)); + item = item->next; + item->type = QD_ZEROED; + item->zeroed = type->align - builtin_type_uint.align; + } if (constant->tagged.tag->size != 0) { item->next = xcalloc(1, sizeof(struct qbe_data_item)); item = item->next;