]> Cypherpunks repositories - gostls13.git/commitdiff
gc: print of unsafe.Pointer
authorRuss Cox <rsc@golang.org>
Fri, 15 Apr 2011 20:16:20 +0000 (16:16 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 15 Apr 2011 20:16:20 +0000 (16:16 -0400)
Got lost when I introduced TUNSAFEPTR.

R=ken2
CC=golang-dev
https://golang.org/cl/4442046

src/cmd/gc/walk.c
test/fixedbugs/bug328.go [new file with mode: 0644]
test/golden.out

index f5a72d891253b97134a94d963a99dffe6e8a2b31..6b94002c5dfb8c32c589f71f34860ef0c7e00e60 100644 (file)
@@ -1785,7 +1785,7 @@ walkprint(Node *nn, NodeList **init, int defer)
                                        on = syslook("printiface", 1);
                                argtype(on, n->type);           // any-1
                        }
-               } else if(isptr[et] || et == TCHAN || et == TMAP || et == TFUNC) {
+               } else if(isptr[et] || et == TCHAN || et == TMAP || et == TFUNC || et == TUNSAFEPTR) {
                        if(defer) {
                                fmtprint(&fmt, "%%p");
                        } else {
diff --git a/test/fixedbugs/bug328.go b/test/fixedbugs/bug328.go
new file mode 100644 (file)
index 0000000..64041f4
--- /dev/null
@@ -0,0 +1,14 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2011 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() {
+       var p unsafe.Pointer
+       println(p)
+}
index f76db3e502e5e1b4c8bdd2630c3317ca1c635f2a..bbe399f28c8a7df6d0b5e08cba1d7d9740ab74c8 100644 (file)
@@ -157,6 +157,9 @@ panic: interface conversion: interface is int, not int32
 panic: interface conversion: interface is main.T, not main.T
 
 
+=========== fixedbugs/bug328.go
+0x0
+
 == bugs/
 
 =========== bugs/bug322.go