From 46e1f128fd310bd29a2b4335b36c60d6cc0aa3a7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Aug 2022 11:06:38 +0200 Subject: initial work on IR --- bootstrap/parse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bootstrap/parse.c') diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 371289f..91c7567 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1644,7 +1644,10 @@ pexprefix(struct parser *P) { ex = pexprefix(P); from = ex.ty; - if (typeof2(to, from)) ; + if (to->t == TYarr && to->length < 0 && ex.t == Eini) { + ex.ty = to = mkarraytype(to->child, ex.ini.maxn + 1); + } + else 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) ; -- cgit v1.2.3