1
0
mirror of https://github.com/golang/go synced 2024-11-26 11:08:38 -07:00

allow any type at all in sys.unreflect;

accomodate empty type table in 6l.

R=r
DELTA=10  (2 added, 8 deleted, 0 changed)
OCL=18601
CL=18605
This commit is contained in:
Russ Cox 2008-11-05 16:09:12 -08:00
parent b3c983f3a0
commit d6a7cefd1e
2 changed files with 2 additions and 8 deletions

View File

@ -451,6 +451,8 @@ definetypesigs(void)
prog->to.sym = all[i]; prog->to.sym = all[i];
} }
s->value = PtrSize*n; s->value = PtrSize*n;
if(n == 0)
s->value = 1; // must have non-zero size or 6l complains
// emit count // emit count
s = lookup("ngotypesigs", 0); s = lookup("ngotypesigs", 0);

View File

@ -449,14 +449,6 @@ fakesigt(string type)
// TODO(rsc): Cache these by type string. // TODO(rsc): Cache these by type string.
Sigt *sigt; 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 = mal(2*sizeof sigt[0]);
sigt[0].name = mal(type->len + 1); sigt[0].name = mal(type->len + 1);
mcpy(sigt[0].name, type->str, type->len); mcpy(sigt[0].name, type->str, type->len);