aboutsummaryrefslogtreecommitdiff
path: root/qbe.c
diff options
context:
space:
mode:
Diffstat (limited to 'qbe.c')
-rw-r--r--qbe.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qbe.c b/qbe.c
index a40540a..66cc271 100644
--- a/qbe.c
+++ b/qbe.c
@@ -479,6 +479,8 @@ objectaddr(struct func *f, struct expr *e)
case EXPRSTRING:
d = stringdecl(e);
return d->value;
+ case EXPRMEMBER:
+ return funcinst(f, IADD, &iptr, funcexpr(f, e->member.base), mkintconst(&iptr, e->member.offset));
case EXPRCOMPOUND:
d = mkdecl(DECLOBJECT, e->type, LINKNONE);
funcinit(f, d, e->compound.init);
@@ -599,6 +601,7 @@ funcexpr(struct func *f, struct expr *e)
if (typeprop(e->type) & PROPINT || e->type->kind == TYPEPOINTER)
return mkintconst(e->type->repr, e->constant.i);
return mkfltconst(e->type->repr, e->constant.f);
+ case EXPRMEMBER:
case EXPRCOMPOUND:
l = objectaddr(f, e);
return funcload(f, e->type, l);