summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/align.c5
-rw-r--r--src/cmd/gc/subr.c2
-rw-r--r--src/cmd/gc/typecheck.c3
3 files changed, 8 insertions, 2 deletions
diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c
index 9a013ca6e..c7c1dfd62 100644
--- a/src/cmd/gc/align.c
+++ b/src/cmd/gc/align.c
@@ -199,9 +199,12 @@ dowidth(Type *t)
if(t->type == T)
break;
dowidth(t->type);
- w = sizeof_Array;
if(t->bound >= 0)
w = t->bound * t->type->width;
+ else if(t->bound == -1)
+ w = sizeof_Array;
+ else
+ fatal("dowidth %T", t); // probably [...]T
break;
case TSTRUCT:
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index 9f160d456..8b7556015 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -1061,6 +1061,8 @@ Tpretty(Fmt *fp, Type *t)
case TARRAY:
if(t->bound >= 0)
return fmtprint(fp, "[%d]%T", (int)t->bound, t->type);
+ if(t->bound == -100)
+ return fmtprint(fp, "[...]%T", t->type);
return fmtprint(fp, "[]%T", t->type);
case TINTER:
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index 9f0beb559..67c6777cf 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -159,7 +159,8 @@ reswitch:
n->type = t;
n->left = N;
n->right = N;
- checkwidth(t);
+ if(t->bound != -100)
+ checkwidth(t);
break;
case OTMAP: