scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 3d3beaf217e707572b132f74eb75fce6b2546850
parent 37d7c9d148c70a2fc1bdae051b874e0afd911791
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 11 Nov 2021 17:51:35 +0100

cc1: Fix struct size calculation

The size added for alignment was calculated in a wrong way,
making that any size was actually duplicated.

Diffstat:
Msrc/cmd/cc/cc1/types.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cmd/cc/cc1/types.c b/src/cmd/cc/cc1/types.c @@ -229,7 +229,7 @@ typesize(Type *tp) * alignment. */ if (tp->op == STRUCT && align-- > 1) - size += size+align & ~align; + size = size+align & ~align; tp->size = size; return; case ENUM: