commit 73be71e38e2f009914a8f1c2994377da02805581
parent ad142e7cbc91eabbc8eefe45f60593f0f7a5a482
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 10 Mar 2021 10:18:07 -0500
gen: fix aggregate types in append
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -680,6 +680,7 @@ gen_expr_append(struct gen_context *ctx,
value = value->next) {
struct qbe_value v = {0};
alloc_temp(ctx, &v, value->expr->result, "append.value.%d");
+ qval_deref(&v);
gen_expression(ctx, value->expr, &v);
v.indirect = false;
ptr.type = type;
diff --git a/src/types.c b/src/types.c
@@ -570,6 +570,7 @@ type_is_assignable(const struct type *to, const struct type *from)
}
assert(0); // Unreachable
case STORAGE_ALIAS:
+ assert(to->alias.type);
return type_is_assignable(to->alias.type, from);
case STORAGE_STRING:
return to->id == builtin_type_ptr_const_char.id;