scc

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

commit f4be5adbc1593fe4b632d6ed8995c41193582971
parent 32f13e84d1f68ada101e8a349c22388bd04a3d36
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: