]> Cypherpunks repositories - gostls13.git/commitdiff
6g: set kind to KindUnsafePointer where appropriate in reflect structures.
authorLuuk van Dijk <lvd@golang.org>
Tue, 5 Oct 2010 19:17:16 +0000 (21:17 +0200)
committerLuuk van Dijk <lvd@golang.org>
Tue, 5 Oct 2010 19:17:16 +0000 (21:17 +0200)
R=rsc, ken2, r
CC=golang-dev
https://golang.org/cl/2355043

src/cmd/gc/reflect.c

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