mirror of
https://github.com/golang/go
synced 2024-10-05 20:21: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:
parent
10f38f51ef
commit
d9f2cafb50
@ -114,6 +114,7 @@ func buildssa(fn *Node) (ssafn *ssa.Func, usessa bool) {
|
|||||||
|
|
||||||
// fallthrough to exit
|
// fallthrough to exit
|
||||||
if b := s.endBlock(); b != nil {
|
if b := s.endBlock(); b != nil {
|
||||||
|
b.Kind = ssa.BlockRet
|
||||||
b.AddEdgeTo(s.exit)
|
b.AddEdgeTo(s.exit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user