diff options
author | Tianon Gravi <admwiggin@gmail.com> | 2015-01-15 22:14:32 -0700 |
---|---|---|
committer | Tianon Gravi <admwiggin@gmail.com> | 2015-01-15 22:14:32 -0700 |
commit | f76df0afd043e05c4b013ab2982e32020839d259 (patch) | |
tree | 447b7688d9af57fad497e61a1cf6789f237c98e9 /src/cmd/gc/reflect.c | |
parent | f971d23c25b6660e666da64eedec69e77b9abbd7 (diff) | |
parent | 90ad8a7e5881be7834909c649f994b6b5244c965 (diff) | |
download | golang-f76df0afd043e05c4b013ab2982e32020839d259.tar.gz |
Merge tag 'upstream/1.4.1' into debian-experimental
* tag 'upstream/1.4.1':
Imported Upstream version 1.4.1
Diffstat (limited to 'src/cmd/gc/reflect.c')
-rw-r--r-- | src/cmd/gc/reflect.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/gc/reflect.c b/src/cmd/gc/reflect.c index b2ff2fbc5..8788a678b 100644 --- a/src/cmd/gc/reflect.c +++ b/src/cmd/gc/reflect.c @@ -143,18 +143,6 @@ mapbucket(Type *t) // We don't need to encode it as GC doesn't care about it. offset = BUCKETSIZE * 1; - overflowfield = typ(TFIELD); - overflowfield->type = ptrto(bucket); - overflowfield->width = offset; // "width" is offset in structure - overflowfield->sym = mal(sizeof(Sym)); // not important but needs to be set to give this type a name - overflowfield->sym->name = "overflow"; - offset += widthptr; - - // The keys are padded to the native integer alignment. - // This is usually the same as widthptr; the exception (as usual) is nacl/amd64. - if(widthreg > widthptr) - offset += widthreg - widthptr; - keysfield = typ(TFIELD); keysfield->type = typ(TARRAY); keysfield->type->type = keytype; @@ -175,11 +163,23 @@ mapbucket(Type *t) valuesfield->sym->name = "values"; offset += BUCKETSIZE * valtype->width; + overflowfield = typ(TFIELD); + overflowfield->type = ptrto(bucket); + overflowfield->width = offset; // "width" is offset in structure + overflowfield->sym = mal(sizeof(Sym)); // not important but needs to be set to give this type a name + overflowfield->sym->name = "overflow"; + offset += widthptr; + + // Pad to the native integer alignment. + // This is usually the same as widthptr; the exception (as usual) is nacl/amd64. + if(widthreg > widthptr) + offset += widthreg - widthptr; + // link up fields - bucket->type = overflowfield; - overflowfield->down = keysfield; + bucket->type = keysfield; keysfield->down = valuesfield; - valuesfield->down = T; + valuesfield->down = overflowfield; + overflowfield->down = T; bucket->width = offset; bucket->local = t->local; |