Commit 1b19134c authored by David Symonds's avatar David Symonds

gc: remove extra paranoia from inlining unsafe.Pointer fix.

R=rsc
CC=golang-dev
https://golang.org/cl/5569075
parent cdbed823
...@@ -1149,7 +1149,9 @@ assignop(Type *src, Type *dst, char **why) ...@@ -1149,7 +1149,9 @@ assignop(Type *src, Type *dst, char **why)
if(why != nil) if(why != nil)
*why = ""; *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"); yyerror("cannot use unsafe.Pointer");
errorexit(); errorexit();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment