diff options
author | Michael Forney <mforney@mforney.org> | 2024-04-27 01:11:36 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-04-27 01:12:22 -0700 |
commit | 85dd122f81322a6de30e547ada17cf8ccf4869fd (patch) | |
tree | a15093bd30008a747c5f01bfda6b77493a3c6c3e | |
parent | 54abcd563ddb7012a7eb19dc1397570f4b6d58a5 (diff) |
qbe: Use expression type when loading
If we are loading the first element of an array, or first member
of a structure, the expression type may be different from the object
type.
-rw-r--r-- | qbe.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -678,7 +678,7 @@ funcexpr(struct func *f, struct expr *e) case EXPRIDENT: d = e->u.ident.decl; switch (d->kind) { - case DECLOBJECT: return funcload(f, d->type, (struct lvalue){d->value}); + case DECLOBJECT: return funcload(f, e->type, (struct lvalue){d->value}); case DECLCONST: return d->value; default: fatal("unimplemented declaration kind %d", d->kind); |