1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:24:45 -07:00

gc: print of unsafe.Pointer

Got lost when I introduced TUNSAFEPTR.

R=ken2
CC=golang-dev
https://golang.org/cl/4442046
This commit is contained in:
Russ Cox 2011-04-15 16:16:20 -04:00
parent 4c137b6162
commit de5616fbb4
3 changed files with 18 additions and 1 deletions

View 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 {

14
test/fixedbugs/bug328.go Normal file
View File

@ -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)
}

View 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