]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix duplicate code generation in swt.go
authorMatthew Dempsky <mdempsky@google.com>
Tue, 13 Mar 2018 22:07:12 +0000 (15:07 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 15 Mar 2018 01:01:56 +0000 (01:01 +0000)
commit463fe95bdd07e255a10ad36d5c51c8811cfee49f
tree0add663ba2124f6556fa43fe36c7d166785e3925
parent183fd6f19b6a88c0174cf3fd5a3b141b159b8225
cmd/compile: fix duplicate code generation in swt.go

When combining adjacent type switch cases with the same type hash, we
failed to actually remove the combined cases, so we would generate
code for them twice.

We use MD5 for type hashes, so collisions are rare, but they do
currently appear in test/fixedbugs/bug248.dir/bug2.go, which is how I
noticed this failure.

Passes toolstash-check.

Change-Id: I66729b3366b96cb8ddc8fa6f3ebea11ef6d74012
Reviewed-on: https://go-review.googlesource.com/100461
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/swt.go