Commit Graph

2 Commits

Author SHA1 Message Date
Alan Donovan 8c66e887f7 go.tools/ssa: a blocking select's implicit "default" case should runtime-panic, not fall through.
Although such a control-flow path is impossible by
construction, we must avoid no-arg returns (even if
unreachable) in non-void functions.

Tested by adding a sanity-check that ssa.Return has the correct arity.
Also: added ssautil.Switches() test.

Fixes golang/go#7702

R=gri, axwalk
CC=golang-codereviews
https://golang.org/cl/46520043
2014-01-02 15:12:23 -05:00
Alan Donovan d6490fa510 go.tools/ssa/ssautil: Switches() utility infers multiway branches.
(Note new subpackage ssa/ssautil.)

R=gri, axwalk, gri
CC=golang-dev
https://golang.org/cl/36710043
2013-12-05 17:00:17 -05:00