History

bitfields: fix long bitfields

now the testcase works on i386-linux as well.

Michael Matz committed 9 years ago

Commit 377e8e51 parent 10948911 file · +3 −3Browse files

Unified · Split

tccgen.c+3−3
@@ -3362,9 +3362,9 @@ static void struct_layout(CType *type, AttributeDef *ad) · 3361 unmodified lines
33623362 (ofs2 / (typealign * 8)) > (size/typealign))) {
33633363 c = (c + ((bit_pos + 7) >> 3) + typealign - 1) & -typealign;
33643364 bit_pos = 0;
3365− } else while (bit_pos + bit_size > size * 8) {
3366− c += size;
3367− bit_pos -= size * 8;
3365+ } else if (bit_pos + bit_size > size * 8) {
3366+ c += bit_pos >> 3;
3367+ bit_pos &= 7;
33683368 }
33693369 offset = c;
33703370 /* In PCC layout named bit-fields influence the alignment

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