diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-07 13:18:42 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-07 22:29:01 +0000 |
commit | 5c59e11f5e1fe2e6d5b684f9a348022c07807126 (patch) | |
tree | 53f266c4c11585eeaf31acdb66d0072b373f7ec5 /test/fixedbugs | |
parent | b003a8b1ae26fa684ec35eb7543efa1ded1bcae7 (diff) | |
download | go-5c59e11f5e1fe2e6d5b684f9a348022c07807126.tar.gz go-5c59e11f5e1fe2e6d5b684f9a348022c07807126.zip |
cmd/compile: remove special-casing of blank in types.sconv{,2}
I'm not sure why blank was special-cased here before, but it's
wrong. Blank is a non-exported identifier, and writing it out without
package-qualification can result in linker symbol collisions.
Fixes #47087.
Change-Id: Ie600037c8e54e3d4fdaeec21e2ca212badbd830b
Reviewed-on: https://go-review.googlesource.com/c/go/+/333163
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r-- | test/fixedbugs/issue47087.dir/a.go | 9 | ||||
-rw-r--r-- | test/fixedbugs/issue47087.dir/b.go | 9 | ||||
-rw-r--r-- | test/fixedbugs/issue47087.dir/main.go | 19 | ||||
-rw-r--r-- | test/fixedbugs/issue47087.go | 7 |
4 files changed, 44 insertions, 0 deletions
diff --git a/test/fixedbugs/issue47087.dir/a.go b/test/fixedbugs/issue47087.dir/a.go new file mode 100644 index 0000000000..6093092ace --- /dev/null +++ b/test/fixedbugs/issue47087.dir/a.go @@ -0,0 +1,9 @@ +// Copyright 2021 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 a + +func F() interface{} { return struct{ _ []int }{} } + +var X = F() diff --git a/test/fixedbugs/issue47087.dir/b.go b/test/fixedbugs/issue47087.dir/b.go new file mode 100644 index 0000000000..8f96d25a12 --- /dev/null +++ b/test/fixedbugs/issue47087.dir/b.go @@ -0,0 +1,9 @@ +// Copyright 2021 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 b + +func F() interface{} { return struct{ _ []int }{} } + +var X = F() diff --git a/test/fixedbugs/issue47087.dir/main.go b/test/fixedbugs/issue47087.dir/main.go new file mode 100644 index 0000000000..ccd0891a61 --- /dev/null +++ b/test/fixedbugs/issue47087.dir/main.go @@ -0,0 +1,19 @@ +// Copyright 2021 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 + +import ( + "a" + "b" +) + +func main() { + if a.F() == b.F() { + panic("FAIL") + } + if a.X == b.X { + panic("FAIL") + } +} diff --git a/test/fixedbugs/issue47087.go b/test/fixedbugs/issue47087.go new file mode 100644 index 0000000000..40df49f83b --- /dev/null +++ b/test/fixedbugs/issue47087.go @@ -0,0 +1,7 @@ +// rundir + +// Copyright 2021 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 ignored |