1
0
mirror of https://github.com/golang/go synced 2024-11-25 03:37:58 -07:00

6g: set kind to KindUnsafePointer where appropriate in reflect structures.

R=rsc, ken2, r
CC=golang-dev
https://golang.org/cl/2355043
This commit is contained in:
Luuk van Dijk 2010-10-05 21:17:16 +02:00
parent 4d4b74c7b3
commit 454f03ff0b

View File

@ -598,6 +598,7 @@ dcommontype(Sym *s, int ot, Type *t)
// alg uint8; // alg uint8;
// align uint8; // align uint8;
// fieldAlign uint8; // fieldAlign uint8;
// kind uint8;
// string *string; // string *string;
// *nameInfo; // *nameInfo;
// } // }
@ -615,9 +616,11 @@ dcommontype(Sym *s, int ot, Type *t)
i = kinds[t->etype]; i = kinds[t->etype];
if(t->etype == TARRAY && t->bound < 0) if(t->etype == TARRAY && t->bound < 0)
i = KindSlice; i = KindSlice;
if(isptr[t->etype] && t->type->etype == TANY)
i = KindUnsafePointer;
if(!haspointers(t)) if(!haspointers(t))
i |= KindNoPointers; i |= KindNoPointers;
ot = duint8(s, ot, i); ot = duint8(s, ot, i); // kind
longsymnames = 1; longsymnames = 1;
p = smprint("%-T", t); p = smprint("%-T", t);
longsymnames = 0; longsymnames = 0;
@ -810,6 +813,7 @@ ok:
case TPTR32: case TPTR32:
case TPTR64: case TPTR64:
if(t->type->etype == TANY) { if(t->type->etype == TANY) {
// ../../pkg/runtime/type.go:/UnsafePointerType
ot = dcommontype(s, ot, t); ot = dcommontype(s, ot, t);
break; break;
} }