commit 15e69825a57a52baceccb096ca1c292980a2a574
parent 6a156cca7975a7f600e89249062c7bf6da72d054
Author: Alexey Yerin <yyp@disroot.org>
Date: Fri, 14 Jan 2022 23:08:29 +0300
gen: emit missing padding at end of tuple globals
My fault, didn't add it from struct path last time.
Fixes: https://todo.sr.ht/~sircmpwn/hare/549
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -3286,6 +3286,17 @@ gen_data_item(struct gen_context *ctx, struct expression *expr,
item->next = xcalloc(1,
sizeof(struct qbe_data_item));
item = item->next;
+ } else {
+ const struct type_tuple *fi = tuple->field;
+ if (fi->offset + fi->type->size
+ != expr->result->size) {
+ item->next = xcalloc(1,
+ sizeof(struct qbe_data_item));
+ item = item->next;
+ item->type = QD_ZEROED;
+ item->zeroed = expr->result->size
+ - (fi->offset + fi->type->size);
+ }
}
}
break;