History

tccgen.c: off by one in flexible array members

tccgen.c: fix fexible array member breaking struct alignment

Henry Kroll III committed 10 years ago

Commit 7e0ad4f1 parent f75f89f1 file · +1 −1Browse files

Unified · Split

tccgen.c+1−1
@@ -5847,7 +5847,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, · 5846 unmodified lines
5847 tcc_error("unknown type size");5847 tcc_error("unknown type size");
5848 }5848 }
5849 if (flexible_array)5849 if (flexible_array)
5850 size += flexible_array->type.ref->c * pointed_size(&flexible_array->type);5850 size += flexible_array->type.ref->c * pointed_size(&flexible_array->type) + 1;
5851 /* take into account specified alignment if bigger */5851 /* take into account specified alignment if bigger */
5852 if (ad->a.aligned) {5852 if (ad->a.aligned) {
5853 if (ad->a.aligned > align)5853 if (ad->a.aligned > align)

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