From a4ddca68662f4bc0531763357b4bc00b6c50b456 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 13 Aug 2022 13:00:37 +0200 Subject: target --- bootstrap/parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bootstrap/parse.c') diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 197b61b..7a35f09 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1360,6 +1360,8 @@ pexpostfix(struct parser *P) { const struct type *ty = ex.ty; if (ty->t == TYptr) ty = ty->child; + bool konst = ty->konst; + ty = unconstify(ty); if (ty->t == TYstruct || ty->t == TYunion || ty->t == TYeunion) { int idx = structfldnam2idx(ty, fnam); struct aggfield *fld = &ty->agg.flds.d[idx]; @@ -1371,7 +1373,7 @@ pexpostfix(struct parser *P) { ex.get.lhs = exprdup(ex); ex.t = Eget; ex.span = tok.span; - ex.ty = ex.ty->konst ? constify(fld->ty) : fld->ty; + ex.ty = konst ? constify(fld->ty) : fld->ty; ex.get.fld = fnam; } else { fatal(P, tok.span, "cannot access `%s': left-hand-side is not an aggregate (%t)", -- cgit v1.2.3