mirror of
https://github.com/golang/go
synced 2024-11-26 06:07:57 -07:00
multiple bugs in bitfield handling
R=r DELTA=6 (3 added, 0 deleted, 3 changed) OCL=26944 CL=26967
This commit is contained in:
parent
3f42f44227
commit
42546f4812
@ -140,6 +140,7 @@ Intrange intranges[] = {
|
||||
};
|
||||
|
||||
static int kindsize[] = {
|
||||
0,
|
||||
0,
|
||||
8,
|
||||
8,
|
||||
@ -366,10 +367,12 @@ parsedef(char **pp, char *name)
|
||||
// into
|
||||
// uint8 x;
|
||||
// hooray for bitfields.
|
||||
while(f->type->kind == Typedef)
|
||||
f->type = f->type->type;
|
||||
while(Int16 <= f->type->kind && f->type->kind <= Uint64 && kindsize[f->type->kind] > f->size) {
|
||||
t = emalloc(sizeof *t);
|
||||
*t = *f->type;
|
||||
f->type = t;
|
||||
tt = emalloc(sizeof *tt);
|
||||
*tt = *f->type;
|
||||
f->type = tt;
|
||||
f->type->kind -= 2;
|
||||
}
|
||||
p++;
|
||||
|
Loading…
Reference in New Issue
Block a user