History

tccgen: skip fields from same union

yuanbin committed 16 years ago

Commit 952e83e1 parent d6ce75b1 file · +8 −2Browse files

Unified · Split

tccgen.c+8−2
@@ -4865,6 +4865,7 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 4864 unmodified lines
4865 index = 0;4865 index = 0;
4866 n = s->c;4866 n = s->c;
4867 while (tok != '}') {4867 while (tok != '}') {
4868 int bit_pos;
4868 decl_designator(type, sec, c, NULL, &f, size_only);4869 decl_designator(type, sec, c, NULL, &f, size_only);
4869 index = f->c;4870 index = f->c;
4870 if (!size_only && array_length < index) {4871 if (!size_only && array_length < index) {
@@ -4876,8 +4877,13 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, · 5 unmodified lines
4876 array_length = index;4877 array_length = index;
4877 4878
4878 /* Coo: skip fields from same union */4879 /* Coo: skip fields from same union */
4879 while (f->next && f->next->c<index)4880 if ((f->type.t&VT_BITFIELD)==0)
4880 f=f->next;4881 bit_pos=index*8;
4882 else
4883 bit_pos=f->c*8+((f->type.t>>VT_STRUCT_SHIFT)&0x3f)+((f->type.t>>(VT_STRUCT_SHIFT+6))&0x3f);
4884 while (f->next && f->next->c<index &&
4885 ((f->next->type.t&VT_BITFIELD)==0 || f->next->c*8+((f->next->type.t>>VT_STRUCT_SHIFT)&0x3f)<bit_pos))
4886 f=f->next;
4881 4887
4882 f = f->next;4888 f = f->next;
4883 if (no_oblock && f == NULL)4889 if (no_oblock && f == NULL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t