mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- 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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user