Fix string16 literal length set in LLVM

This commit is contained in:
gingerBill
2025-08-02 13:11:34 +01:00
parent e049dde582
commit dca9bf0b0c
3 changed files with 12 additions and 7 deletions

View File

@@ -2758,7 +2758,7 @@ gb_internal LLVMValueRef lb_find_or_add_entity_string16_ptr(lbModule *m, String1
LLVMValueRef global_data = LLVMAddGlobal(m->mod, type, name);
LLVMSetInitializer(global_data, data);
lb_make_global_private_const(global_data);
LLVMSetAlignment(global_data, 1);
LLVMSetAlignment(global_data, 2);
LLVMValueRef ptr = LLVMConstInBoundsGEP2(type, global_data, indices, 2);
if (!custom_link_section) {
@@ -2855,7 +2855,7 @@ gb_internal lbValue lb_find_or_add_entity_string16_slice_with_type(lbModule *m,
LLVMValueRef global_data = LLVMAddGlobal(m->mod, type, name);
LLVMSetInitializer(global_data, data);
lb_make_global_private_const(global_data);
LLVMSetAlignment(global_data, 1);
LLVMSetAlignment(global_data, 2);
i64 data_len = str.len;
LLVMValueRef ptr = nullptr;