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:
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: