cmd/compile: fix inlining name mangling for blank label

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>
This commit is contained in:
Cuong Manh Le 2024-11-03 15:52:29 +07:00 committed by Gopher Robot
parent 76f3e0ac8d
commit 324f41b748
2 changed files with 18 additions and 1 deletions

View 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)

View File

@ -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()
}