diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index f5a72d89125..6b94002c5df 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -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 index 00000000000..64041f41290 --- /dev/null +++ b/test/fixedbugs/bug328.go @@ -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) +} diff --git a/test/golden.out b/test/golden.out index f76db3e502e..bbe399f28c8 100644 --- a/test/golden.out +++ b/test/golden.out @@ -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