aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-04-25 15:46:30 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-04-27 01:16:39 +0000
commit40254ec0db6d02118df141dbe7fcb6a95aec6560 (patch)
treee616fa1b967eaaa3f9b5d333ecac7d5ca707c308 /test
parent903b25178e51fa96d37a91b020747ce236ba04f0 (diff)
downloadgo-40254ec0db6d02118df141dbe7fcb6a95aec6560.tar.gz
go-40254ec0db6d02118df141dbe7fcb6a95aec6560.zip
cmd/compile: fix wrong package path for unsafe.Pointer
It's not a predeclared type, but a type defined in "unsafe" package. Fixes #44830 Change-Id: If39815b1070059b608be8231dfac9b7f3307cb15 Reviewed-on: https://go-review.googlesource.com/c/go/+/313349 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue44830.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/fixedbugs/issue44830.go b/test/fixedbugs/issue44830.go
new file mode 100644
index 0000000000..7df5aeb857
--- /dev/null
+++ b/test/fixedbugs/issue44830.go
@@ -0,0 +1,19 @@
+// run
+
+// 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 (
+ "reflect"
+ "unsafe"
+)
+
+func main() {
+ t := reflect.TypeOf(unsafe.Pointer(nil))
+ if pkgPath := t.PkgPath(); pkgPath != "unsafe" {
+ panic("unexpected t.PkgPath(): " + pkgPath)
+ }
+}