commit 83c6871903026a97dab42212a527cc3076525a0d
parent a927ad1e6d57666db87b6294eed6a8bfe2a482fa
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 28 Dec 2020 10:09:39 -0500
gen: fix &array
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -142,7 +142,7 @@ gen_store(struct gen_context *ctx,
&& dest->type->stype != Q__VOID); // Invariant
if (src->type->stype == Q__AGGREGATE) {
- assert(!dest->indirect && !src->indirect);
+ assert(!src->indirect);
if (dest->type->stype == Q__AGGREGATE) {
assert(0); // TODO: memcpy
} else {
@@ -539,8 +539,11 @@ gen_expr_address(struct gen_context *ctx,
assert(0); // TODO
}
- assert(src.indirect);
- qval_address(&src);
+ if (src.indirect) {
+ qval_address(&src);
+ } else {
+ assert(type_is_aggregate(operand->result));
+ }
gen_store(ctx, out, &src);
}