]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix inlining name mangling for blank label
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sun, 3 Nov 2024 08:52:29 +0000 (15:52 +0700)
committerGopher Robot <gobot@golang.org>
Mon, 4 Nov 2024 16:46:35 +0000 (16:46 +0000)
Fixes #70175

Change-Id: I13767d951455854b03ad6707ff9292cfe9097ee9
Reviewed-on: https://go-review.googlesource.com/c/go/+/624377
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>

src/cmd/compile/internal/noder/reader.go
test/fixedbugs/issue70175.go [new file with mode: 0644]

index 39ac1400a0f8c6d8d8d0f46d97f4bc2cfd38dc45..eca66487fa26daf58ce20cbe63817f3cc29f7a93 100644 (file)
@@ -2068,7 +2068,7 @@ func (r *reader) switchStmt(label *types.Sym) ir.Node {
 func (r *reader) label() *types.Sym {
        r.Sync(pkgbits.SyncLabel)
        name := r.String()
-       if r.inlCall != nil {
+       if r.inlCall != nil && name != "_" {
                name = fmt.Sprintf("~%s·%d", name, inlgen)
        }
        return typecheck.Lookup(name)
diff --git a/test/fixedbugs/issue70175.go b/test/fixedbugs/issue70175.go
new file mode 100644 (file)
index 0000000..0ad6e39
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func f() {
+_:
+
+_:
+}
+
+func main() {
+       f()
+}