From c129f77ad724aa940b53a125de0e1e4de0ca7240 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 14 Aug 2022 09:25:16 +0200 Subject: fix arena --- 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 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) ; -- cgit v1.2.3