]> Cypherpunks repositories - gostls13.git/commitdiff
gc: fix crash when using -u
authorRuss Cox <rsc@golang.org>
Thu, 17 Mar 2011 01:05:40 +0000 (21:05 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 17 Mar 2011 01:05:40 +0000 (21:05 -0400)
R=ken2
CC=golang-dev
https://golang.org/cl/4278056

src/cmd/gc/typecheck.c

index a9389bb9629dec6eadd81547c449b60423969833..b4fd55f5df115912ab6041538d6afeb8acb77f57 100644 (file)
@@ -1311,7 +1311,7 @@ ret:
 
        // TODO(rsc): should not need to check importpkg,
        // but reflect mentions unsafe.Pointer.
-       if(safemode && !incannedimport && !importpkg && t->etype == TUNSAFEPTR)
+       if(safemode && !incannedimport && !importpkg && t && t->etype == TUNSAFEPTR)
                yyerror("cannot use unsafe.Pointer");
 
        evconst(n);