aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorwrathdoesthat <152635455+wrathdoesthat@users.noreply.github.com>2025-10-15 10:09:47 -0400
committerGitHub <noreply@github.com>2025-10-15 10:09:47 -0400
commit798f4b011cfb3aa80d791e1e1b93331b0b5c8d4b (patch)
treed34c106215eb6e0c2220aec496d66c81ab1d5fc0 /src/llvm_backend_general.cpp
parent6356cadfcc6ec6b3491bdad61621ac4dfecc91f1 (diff)
parent4b8751bebdbf40528c2af8ff5a4ef38c1ab429cc (diff)
Merge branch 'odin-lang:master' into master
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 003278b82..aa6f7e014 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -2999,7 +2999,11 @@ gb_internal lbValue lb_find_or_add_entity_string_byte_slice_with_type(lbModule *
Type *bt = base_type(slice_type);
Type *elem = bt->Slice.elem;
i64 sz = type_size_of(elem);
+ i64 align = type_align_of(elem);
GB_ASSERT(sz > 0);
+ GB_ASSERT(align > 0);
+
+ LLVMSetAlignment(global_data, (u32)align);
ptr = LLVMConstPointerCast(ptr, lb_type(m, alloc_type_pointer(elem)));
data_len /= sz;
}
@@ -3054,7 +3058,11 @@ gb_internal lbValue lb_find_or_add_entity_string16_slice_with_type(lbModule *m,
Type *bt = base_type(slice_type);
Type *elem = bt->Slice.elem;
i64 sz = type_size_of(elem);
+ i64 align = type_align_of(elem);
GB_ASSERT(sz > 0);
+ GB_ASSERT(align > 0);
+
+ LLVMSetAlignment(global_data, (u32)align);
ptr = LLVMConstPointerCast(ptr, lb_type(m, alloc_type_pointer(elem)));
data_len /= sz;
}