aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/check.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/ssa/check.go')
-rw-r--r--src/cmd/compile/internal/ssa/check.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/check.go b/src/cmd/compile/internal/ssa/check.go
index 4ea8561304..a41c110faa 100644
--- a/src/cmd/compile/internal/ssa/check.go
+++ b/src/cmd/compile/internal/ssa/check.go
@@ -274,6 +274,10 @@ func checkFunc(f *Func) {
}
}
+ if (v.Op == OpStructMake || v.Op == OpArrayMake1) && v.Type.Size() == 0 {
+ f.Fatalf("zero-sized Make; use Empty instead %v", v)
+ }
+
if f.RegAlloc != nil && f.Config.SoftFloat && v.Type.IsFloat() {
f.Fatalf("unexpected floating-point type %v", v.LongString())
}