diff options
| author | 2022-08-14 09:25:16 +0200 | |
|---|---|---|
| committer | 2022-08-14 09:25:16 +0200 | |
| commit | c129f77ad724aa940b53a125de0e1e4de0ca7240 (patch) | |
| tree | 57ad369bcfe02d0fb8a311c659e45cf2ae5df075 /bootstrap/parse.c | |
| parent | 66ed623e65ab9350f08061fe7cf12b989c84f65c (diff) | |
fix arena
Diffstat (limited to 'bootstrap/parse.c')
| -rw-r--r-- | bootstrap/parse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 75a3279..4a1721d 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1195,12 +1195,13 @@ pexprimary(struct parser *P) { P->used_targty = 1; if (!P->targty) fatal(P, tok.span, "cannot infer type for compound initializer"); - if (lexmatch(P, &tok, '}')) + if (lexmatch(P, NULL, '}')) ex.t = Ezeroini, ex.ty = P->targty; else if (P->targty->t == TYstruct || P->targty->t == TYunion) ex = parsestructini(P, P->targty); else if (P->targty->t == TYarr) ex = parsearrini(P, P->targty); + ex.span = tok.span; } else if (lexmatch(P, &tok, TKkw_sizeof)) { ex.t = Eintlit; ex.ty = ty_isize; @@ -1560,6 +1561,7 @@ pexprefix(struct parser *P) { if (typeof2(to, from)) ; else if (to->t == TYint && from->t == TYptr && to->size == from->size) ; else if (from->t == TYint && to->t == TYptr && to->size == from->size) ; + else if (from->t == TYptr && to->t == TYptr) ; else if (from->t == TYbool && to->t == TYint) ; else if (from->t == TYint && to->t == TYbool) ; else if (from->t == TYenum && to->t == TYint) ; |