tccgen.c: fix fexible array member breaking struct alignment
Unified · Split
| @@ -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) |