diff options
| author | Laytan <laytanlaats@hotmail.com> | 2024-04-25 00:19:48 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-05-07 16:52:46 +0200 |
| commit | d93cc18dacf7800972cab91053fc1ed3c68dd34b (patch) | |
| tree | 0b57fc3031a8a204efaace1762b49d4bb9cbf87c /src/types.cpp | |
| parent | ecddf3b7f10b02028bf41674c9414b9307f8dae9 (diff) | |
fix packed gep loads with wrong alignment
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 3ec05059f..55d083a9a 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -321,6 +321,7 @@ enum TypeFlag : u32 { TypeFlag_Polymorphic = 1<<1, TypeFlag_PolySpecialized = 1<<2, TypeFlag_InProcessOfCheckingPolymorphic = 1<<3, + TypeFlag_Packed = 1<<4, }; struct Type { @@ -3671,6 +3672,9 @@ gb_internal i64 type_align_of(Type *t) { if (t == nullptr) { return 1; } + if (t->flags & TypeFlag_Packed) { + return 1; + } if (t->kind != Type_Named && t->cached_align > 0) { return t->cached_align.load(); } |