1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.ssa] cmd/compile/internal/ssa: fix fallthrough return

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>
This commit is contained in:
Keith Randall 2015-09-03 14:28:52 -07:00
parent 10f38f51ef
commit d9f2cafb50

View 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)
}