aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal')
-rw-r--r--src/cmd/compile/internal/reflectdata/alg.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/reflectdata/alg.go b/src/cmd/compile/internal/reflectdata/alg.go
index eb46ed84aa..f74a42eac1 100644
--- a/src/cmd/compile/internal/reflectdata/alg.go
+++ b/src/cmd/compile/internal/reflectdata/alg.go
@@ -785,6 +785,9 @@ func (e *eqSigBuilder) build(t *types.Type) {
// The generated loops are kind of inefficient as well,
// so unroll the loop a bit.
const unrollSize = 32 // make loop body compare around this many bytes
+ if et.Size() == 0 {
+ break // zero-size elements need no comparison
+ }
unroll := max(1, unrollSize/et.Size())
// Do partial loops directly.
for n%unroll != 0 {