- Fix alignment for uint128 to 16 with WASM targets.

- Incorrect assert in struct alignment checking #2841
- Packed structs sometimes not lowered as such.
This commit is contained in:
Christoffer Lerno
2026-01-25 23:05:43 +01:00
parent 4899ee14e2
commit e901a3de55
9 changed files with 50 additions and 11 deletions

View File

@@ -679,7 +679,7 @@ static bool sema_analyse_struct_members(SemaContext *context, Decl *decl)
}
if (is_unaligned && size > offset)
{
ASSERT(!decl->strukt.padding);
ASSERT(!decl->strukt.padding || decl->strukt.padding == size - offset);
decl->strukt.padding = size - offset;
}
@@ -703,7 +703,7 @@ static bool sema_analyse_struct_members(SemaContext *context, Decl *decl)
}
}
decl->is_packed = is_unaligned;
decl->is_packed |= is_unaligned;
// Strip padding if we are aligned.
if (!decl->is_packed && is_naturally_aligned)
{