From 81786649c54c5e45765de12cbdf11c9081614506 Mon Sep 17 00:00:00 2001 From: Philip Hofer Date: Wed, 21 Feb 2018 13:35:08 -0800 Subject: [PATCH] cmd/compile/internal/ssa: clear branch likeliness in clobberBlock The branchelim pass makes some blocks unreachable, but does not remove them from Func.Values. Consequently, ssacheck complains when it finds a block with a non-zero likeliness value but no successors. Fixes #24014 Change-Id: I2dcf1d8f4e769a2f363508dab3b11198ead336b6 Reviewed-on: https://go-review.googlesource.com/96075 Reviewed-by: Josh Bleecher Snyder Run-TryBot: Philip Hofer TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/ssa/branchelim.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go index a37b8f06e1..54508985b3 100644 --- a/src/cmd/compile/internal/ssa/branchelim.go +++ b/src/cmd/compile/internal/ssa/branchelim.go @@ -139,6 +139,7 @@ func clobberBlock(b *Block) { b.Succs = nil b.Aux = nil b.SetControl(nil) + b.Likely = BranchUnknown b.Kind = BlockInvalid } -- 2.48.1