diff options
| author | Henry Kroll III <henry@comptune.com> | 2016-03-10 08:28:26 -0800 |
|---|---|---|
| committer | Henry Kroll III <henry@comptune.com> | 2016-03-10 08:28:26 -0800 |
| commit | 7e0ad4fdd2d5359799f16732df07e00c8719c1e6 (patch) | |
| tree | 40349545a39d7b8fe1bec64a791eba1989612833 /tccgen.c | |
| parent | f75f89fc8f2116c4cfe35022c19ed854e6a23b84 (diff) | |
| download | tinycc-7e0ad4fdd2d5359799f16732df07e00c8719c1e6.tar.gz tinycc-7e0ad4fdd2d5359799f16732df07e00c8719c1e6.tar.bz2 | |
tccgen.c: off by one in flexible array members
tccgen.c: fix fexible array member breaking struct alignment
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5847,7 +5847,7 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r, tcc_error("unknown type size"); } if (flexible_array) - size += flexible_array->type.ref->c * pointed_size(&flexible_array->type); + size += flexible_array->type.ref->c * pointed_size(&flexible_array->type) + 1; /* take into account specified alignment if bigger */ if (ad->a.aligned) { if (ad->a.aligned > align) |
