aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authornimelehin <nimelehin@gmail.com>2022-04-11 19:54:30 +0300
committerGopher Robot <gobot@golang.org>2022-04-12 00:32:31 +0000
commitbe0262a1279ab37ff2cae562de37afd333f5ada4 (patch)
tree2bbaa793df1ca93e0608d14fbe4b49aa5bf2c073 /src/cmd
parentec5e5dba6fbc4549f167c6db509a800e163296c8 (diff)
downloadgo-be0262a1279ab37ff2cae562de37afd333f5ada4.tar.xz
cmd/compile: fix compilation crash with several blank labels
Fixes #52278 Change-Id: Ibf67c7b019feec277d316e04d93b458efea133fb Reviewed-on: https://go-review.googlesource.com/c/go/+/399574 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/escape/escape.go3
-rw-r--r--src/cmd/compile/internal/escape/stmt.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/escape/escape.go b/src/cmd/compile/internal/escape/escape.go
index 4713ecddca..4408a531ec 100644
--- a/src/cmd/compile/internal/escape/escape.go
+++ b/src/cmd/compile/internal/escape/escape.go
@@ -210,6 +210,9 @@ func (b *batch) walkFunc(fn *ir.Func) {
switch n.Op() {
case ir.OLABEL:
n := n.(*ir.LabelStmt)
+ if n.Label.IsBlank() {
+ break
+ }
if e.labels == nil {
e.labels = make(map[*types.Sym]labelState)
}
diff --git a/src/cmd/compile/internal/escape/stmt.go b/src/cmd/compile/internal/escape/stmt.go
index 0afb5d64ef..4e8dd904ff 100644
--- a/src/cmd/compile/internal/escape/stmt.go
+++ b/src/cmd/compile/internal/escape/stmt.go
@@ -50,6 +50,9 @@ func (e *escape) stmt(n ir.Node) {
case ir.OLABEL:
n := n.(*ir.LabelStmt)
+ if n.Label.IsBlank() {
+ break
+ }
switch e.labels[n.Label] {
case nonlooping:
if base.Flag.LowerM > 2 {