gc: permit unsafe.Pointer for inlined functions.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5573075
This commit is contained in:
David Symonds 2012-01-27 13:44:48 +11:00
parent b62a5099e4
commit 2332439b1b
1 changed files with 1 additions and 1 deletions

View File

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