diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-05-02 19:23:17 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-05-07 16:52:46 +0200 |
| commit | 77efdcd89911f1c9b831cfcf5e5aba49ec8d53d5 (patch) | |
| tree | 331fd8d41472f19008ca1e85b22a5a06018fb25c | |
| parent | 58c0abb98d50fa9f2cd1e0ab2ce255430f5d9253 (diff) | |
fix packed gep loads with wrong alignment
| -rw-r--r-- | src/checker.cpp | 2 | ||||
| -rw-r--r-- | src/llvm_backend.hpp | 1 | ||||
| -rw-r--r-- | src/types.cpp | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 047017290..70ca4fc47 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -4315,7 +4315,7 @@ gb_internal bool correct_single_type_alias(CheckerContext *c, Entity *e) { gb_internal bool correct_type_alias_in_scope_backwards(CheckerContext *c, Scope *s) { bool correction = false; - for (u32 n = s->elements.capacity, i = n-1; i < n; i--) { + for (u32 n = s->elements.count, i = n-1; i < n; i--) { auto const &entry = s->elements.entries[i]; Entity *e = entry.value; if (entry.hash && e != nullptr) { diff --git a/src/llvm_backend.hpp b/src/llvm_backend.hpp index 9f7bc8843..0fed376aa 100644 --- a/src/llvm_backend.hpp +++ b/src/llvm_backend.hpp @@ -66,6 +66,7 @@ struct lbProcedure; struct lbValue { LLVMValueRef value; Type *type; + bool is_packed; }; diff --git a/src/types.cpp b/src/types.cpp index 0c6729b87..3ec05059f 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -948,6 +948,7 @@ gb_internal void set_base_type(Type *t, Type *base) { } } + gb_internal Type *alloc_type(TypeKind kind) { // gbAllocator a = heap_allocator(); gbAllocator a = permanent_allocator(); |