]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/ssa: stop compilation immediately on leading goto
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 4 Jul 2015 20:01:04 +0000 (13:01 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sun, 5 Jul 2015 03:51:44 +0000 (03:51 +0000)
There is clearly work to do to fix labels and gotos.
The compiler currently hangs on ken/label.go.

For the moment, stop the bleeding.

Fixes the build.

Change-Id: Ib68360d583cf53e1a8ca4acff50644b570382728
Reviewed-on: https://go-review.googlesource.com/11877
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go

index 9ad28900032a898c209ae2a609556755e3a710f5..b21b4137dcd8f3047a5b8277257016ee08042e22 100644 (file)
@@ -330,6 +330,7 @@ func (s *state) stmt(n *Node) {
                }
                if n.Op == OGOTO && s.curBlock == nil {
                        s.Unimplementedf("goto at start of function; see test/goto.go")
+                       panic("stop compiling here, on pain of infinite loops")
                }
 
        case OAS, OASWB: