]> Cypherpunks repositories - gostls13.git/commitdiff
allow any type at all in sys.unreflect;
authorRuss Cox <rsc@golang.org>
Thu, 6 Nov 2008 00:09:12 +0000 (16:09 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 6 Nov 2008 00:09:12 +0000 (16:09 -0800)
accomodate empty type table in 6l.

R=r
DELTA=10  (2 added, 8 deleted, 0 changed)
OCL=18601
CL=18605

src/cmd/6l/go.c
src/runtime/iface.c

index 19984336b3d6c05ca76178a688bb361c51deb50e..4d2f5ec54129eae3f3e1c9858cdae6dbd6f6447f 100644 (file)
@@ -451,6 +451,8 @@ definetypesigs(void)
                prog->to.sym = all[i];
        }
        s->value = PtrSize*n;
+       if(n == 0)
+               s->value = 1;   // must have non-zero size or 6l complains
 
        // emit count
        s = lookup("ngotypesigs", 0);
index 4a394fc888bb26df799239241865fd50820d50e8..07bd325843a7739b0adb1603285785c3a615fd64 100644 (file)
@@ -449,14 +449,6 @@ fakesigt(string type)
        // TODO(rsc): Cache these by type string.
        Sigt *sigt;
 
-       // Must be pointer in order for alg, width to be right.
-       if(type == nil || type->len == 0 || type->str[0] != '*') {
-               // TODO(rsc): What to do here?
-               prints("bad unreflect type: ");
-               sys·printstring(type);
-               prints("\n");
-               throw("unreflect");
-       }
        sigt = mal(2*sizeof sigt[0]);
        sigt[0].name = mal(type->len + 1);
        mcpy(sigt[0].name, type->str, type->len);