]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't crash on -d=ssa/
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 16 Dec 2018 17:44:31 +0000 (18:44 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 26 Feb 2019 17:50:01 +0000 (17:50 +0000)
commitbe9c534cdef07630606fde23344fc8a5d769a04e
tree7d1730486c63a3f94a2a7eced7e131f7f8aa2b6d
parent467456b0afcbe8b74c49b356f0e5d41d1c6efc9f
cmd/compile: don't crash on -d=ssa/

I forgot how to pull up the ssa debug options help, so instead of
writing -d=ssa/help, I just wrote -d=ssa/. Much to my amusement, the
compiler just crashed, as shown below. Fix that.

panic: runtime error: index out of range

goroutine 1 [running]:
cmd/compile/internal/ssa.PhaseOption(0x7ffc375d2b70, 0x0, 0xdbff91, 0x5, 0x1, 0x0, 0x0, 0x1, 0x1)
    /home/mvdan/tip/src/cmd/compile/internal/ssa/compile.go:327 +0x1876
cmd/compile/internal/gc.Main(0xde7bd8)
    /home/mvdan/tip/src/cmd/compile/internal/gc/main.go:411 +0x41d0
main.main()
    /home/mvdan/tip/src/cmd/compile/main.go:51 +0xab

Change-Id: Ia2ad394382ddf8f4498b16b5cfb49be0317fc1aa
Reviewed-on: https://go-review.googlesource.com/c/154421
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/compile.go
src/cmd/go/testdata/script/gcflags_patterns.txt