aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/typecheck.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/typecheck/typecheck.go')
-rw-r--r--src/cmd/compile/internal/typecheck/typecheck.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/typecheck.go b/src/cmd/compile/internal/typecheck/typecheck.go
index 1650144375..4c5472137a 100644
--- a/src/cmd/compile/internal/typecheck/typecheck.go
+++ b/src/cmd/compile/internal/typecheck/typecheck.go
@@ -1330,6 +1330,9 @@ func typecheckaste(op ir.Op, call ir.Node, isddd bool, tstruct *types.Type, nl i
n1 := tstruct.NumFields()
n2 := len(nl)
if !hasddd(tstruct) {
+ if isddd {
+ goto invalidddd
+ }
if n2 > n1 {
goto toomany
}
@@ -1395,6 +1398,8 @@ func typecheckaste(op ir.Op, call ir.Node, isddd bool, tstruct *types.Type, nl i
if i < len(nl) {
goto toomany
}
+
+invalidddd:
if isddd {
if call != nil {
base.Errorf("invalid use of ... in call to %v", call)