mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
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:
parent
76f3e0ac8d
commit
324f41b748
@ -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)
|
||||
|
17
test/fixedbugs/issue70175.go
Normal file
17
test/fixedbugs/issue70175.go
Normal 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()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user