]> Cypherpunks repositories - gostls13.git/commitdiff
add bug246 (issue 492)
authorRuss Cox <rsc@golang.org>
Tue, 19 Jan 2010 02:26:10 +0000 (18:26 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 19 Jan 2010 02:26:10 +0000 (18:26 -0800)
R=r
CC=golang-dev
https://golang.org/cl/186216

test/bugs/bug246.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug246.go b/test/bugs/bug246.go
new file mode 100644 (file)
index 0000000..e46cdfd
--- /dev/null
@@ -0,0 +1,18 @@
+// $G $D/$F.go || echo BUG: bug246
+
+// Copyright 2009 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 "unsafe"
+
+func main() {
+       // works
+       addr := uintptr(0)
+       _ = (*int)(unsafe.Pointer(addr))
+
+       // fails
+       _ = (*int)(unsafe.Pointer(uintptr(0)))
+}
index 051bb9bc70d897ad0ad46a098c8b6821bda23bda..906ecac2bb36b04daeb15e40cd3c87368d224292 100644 (file)
@@ -149,3 +149,8 @@ panic PC=xxx
 bad map check 13 false false
 panic PC=xxx
 BUG: tuple evaluation order
+
+=========== bugs/bug246.go
+bugs/bug246.go:17: cannot convert 0 to type unsafe.Pointer
+bugs/bug246.go:17: cannot convert 0 (type uintptr) to type *int in conversion
+BUG: bug246