]> Cypherpunks repositories - gostls13.git/commitdiff
gc: remove extra paranoia from inlining unsafe.Pointer fix.
authorDavid Symonds <dsymonds@golang.org>
Fri, 27 Jan 2012 02:59:32 +0000 (13:59 +1100)
committerDavid Symonds <dsymonds@golang.org>
Fri, 27 Jan 2012 02:59:32 +0000 (13:59 +1100)
R=rsc
CC=golang-dev
https://golang.org/cl/5569075

src/cmd/gc/subr.c

index 0a377822ea1152775af0214327690ac0b83c3ba7..64a0070776396b93578a5db0fe4c4e1392c36470 100644 (file)
@@ -1149,7 +1149,9 @@ assignop(Type *src, Type *dst, char **why)
        if(why != nil)
                *why = "";
 
-       if(safemode && (importpkg == nil || importpkg == localpkg) && src != T && src->etype == TUNSAFEPTR) {
+       // TODO(rsc,lvd): This behaves poorly in the presence of inlining.
+       // https://code.google.com/p/go/issues/detail?id=2795
+       if(safemode && importpkg == nil && src != T && src->etype == TUNSAFEPTR) {
                yyerror("cannot use unsafe.Pointer");
                errorexit();
        }