Commit 463fe95
committed
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 <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Josh Bleecher Snyder <[email protected]>1 parent 183fd6f commit 463fe95
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | | - | |
808 | | - | |
| 806 | + | |
| 807 | + | |
809 | 808 | | |
810 | | - | |
| 809 | + | |
811 | 810 | | |
812 | 811 | | |
813 | 812 | | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | | - | |
| 817 | + | |
| 818 | + | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| |||
0 commit comments