From: David Symonds Date: Fri, 27 Jan 2012 02:44:48 +0000 (+1100) Subject: gc: permit unsafe.Pointer for inlined functions. X-Git-Tag: weekly.2012-01-27~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2332439b1b02789f5cfeceb78458eb34981e28c8;p=gostls13.git gc: permit unsafe.Pointer for inlined functions. R=rsc, rsc CC=golang-dev https://golang.org/cl/5573075 --- diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index f3934ad243..0a377822ea 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -1149,7 +1149,7 @@ assignop(Type *src, Type *dst, char **why) if(why != nil) *why = ""; - if(safemode && src != T && src->etype == TUNSAFEPTR) { + if(safemode && (importpkg == nil || importpkg == localpkg) && src != T && src->etype == TUNSAFEPTR) { yyerror("cannot use unsafe.Pointer"); errorexit(); }