commit 9371a410171d2deccc4509e7620c7abbfc05ad76
parent 78989a15dfcc301ac2eca07afb1f906e172bd48b
Author: Bor Grošelj Simić <bgs@turminal.net>
Date: Sun, 29 May 2022 23:52:04 +0200
fix incorrect sizeof parameter
fortunately sizeof(ast_type) > sizeof(incomplete_enum_type)
Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/check.c b/src/check.c
@@ -3261,7 +3261,8 @@ incomplete_enum_field_create(struct context *ctx, struct scope *imports,
etype, f->next);
}
assert(etype->storage == STORAGE_ENUM);
- struct incomplete_enum_field *field = xcalloc(1, sizeof(struct ast_type));
+ struct incomplete_enum_field *field =
+ xcalloc(1, sizeof(struct incomplete_enum_field));
*field = (struct incomplete_enum_field){
.field = f,
.type = etype,