Commit 42546f48 authored by Russ Cox's avatar Russ Cox

multiple bugs in bitfield handling

R=r
DELTA=6  (3 added, 0 deleted, 3 changed)
OCL=26944
CL=26967
parent 3f42f442
...@@ -140,6 +140,7 @@ Intrange intranges[] = { ...@@ -140,6 +140,7 @@ Intrange intranges[] = {
}; };
static int kindsize[] = { static int kindsize[] = {
0,
0, 0,
8, 8,
8, 8,
...@@ -366,10 +367,12 @@ parsedef(char **pp, char *name) ...@@ -366,10 +367,12 @@ parsedef(char **pp, char *name)
// into // into
// uint8 x; // uint8 x;
// hooray for bitfields. // 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) { while(Int16 <= f->type->kind && f->type->kind <= Uint64 && kindsize[f->type->kind] > f->size) {
t = emalloc(sizeof *t); tt = emalloc(sizeof *tt);
*t = *f->type; *tt = *f->type;
f->type = t; f->type = tt;
f->type->kind -= 2; f->type->kind -= 2;
} }
p++; p++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment