aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/parse.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-20 11:06:38 +0200
committerlemon <lsof@mailbox.org>2022-08-20 11:06:38 +0200
commit46e1f128fd310bd29a2b4335b36c60d6cc0aa3a7 (patch)
treefeb93a69cf93773d0542435ae09c76de04e509c8 /bootstrap/parse.c
parentdf41a4512932f1312e4725d0409757a683b091ed (diff)
initial work on IR
Diffstat (limited to 'bootstrap/parse.c')
-rw-r--r--bootstrap/parse.c5
1 files changed, 4 insertions, 1 deletions
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) ;