harec

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

commit db8a566b40c0873d76fa2f5b764d7a373470969e
parent 1e2b6a1c399039c995448b35543a0bb0d31095d5
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue,  2 Feb 2021 22:25:55 -0500

gen: fix empty autofill field initializers

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

diff --git a/src/gen.c b/src/gen.c @@ -1902,6 +1902,12 @@ gen_expr_struct(struct gen_context *ctx, const struct expr_struct_field *field = &expr->_struct.fields; while (field) { + if (!field->value) { + assert(expr->_struct.autofill); + field = field->next; + continue; + } + constl(&offset, field->field->offset); ptr.type = &qbe_long; pushi(ctx->current, &ptr, Q_ADD, &base, &offset, NULL);