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
58475847 tcc_error("unknown type size");
58485848 }
58495849 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;
58515851 /* take into account specified alignment if bigger */
58525852 if (ad->a.aligned) {
58535853 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