]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/internal/ssa: fix fallthrough return
authorKeith Randall <khr@golang.org>
Thu, 3 Sep 2015 21:28:52 +0000 (14:28 -0700)
committerKeith Randall <khr@golang.org>
Thu, 3 Sep 2015 22:04:07 +0000 (22:04 +0000)
Fallthrough return needs to be a return block before jumping
to the exit block.

Change-Id: I994de2064da5c326c9cade2c33cbb15bdbce5acb
Reviewed-on: https://go-review.googlesource.com/14256
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/ssa.go

index f0cad90d40d8ffd90b7ef55c300ea1ef96a4cc23..c2ad49e95484889e09d584f9fb4ada4e0c3a51d5 100644 (file)
@@ -114,6 +114,7 @@ func buildssa(fn *Node) (ssafn *ssa.Func, usessa bool) {
 
        // fallthrough to exit
        if b := s.endBlock(); b != nil {
+               b.Kind = ssa.BlockRet
                b.AddEdgeTo(s.exit)
        }