From 2c6ff002618aa4d3499aa809bd7b68210cc768ed Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 1 Aug 2025 10:55:04 +0200 Subject: [PATCH] Fix alignment. --- src/compiler/llvm_codegen_expr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index 9322f653c..394a4d185 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -4722,7 +4722,7 @@ static void llvm_emit_const_expr(GenContext *c, BEValue *be_value, Expr *expr) case CONST_STRING: { Type *str_type = type_lowering(expr->type); - bool is_array = str_type->type_kind == TYPE_ARRAY || str_type->type_kind == TYPE_VECTOR; + bool is_array = str_type->type_kind == TYPE_ARRAY || (str_type->type_kind == TYPE_VECTOR && type_size(type->array.base) == 1); if (is_array && llvm_is_global_eval(c)) { // In the global alloc case, create the byte array. @@ -4776,7 +4776,7 @@ static void llvm_emit_const_expr(GenContext *c, BEValue *be_value, Expr *expr) LLVMSetInitializer(global_name, data); if (is_array) { - llvm_value_set_address(c, be_value, global_name, type, type_alloca_alignment(expr->type)); + llvm_value_set_address(c, be_value, global_name, type, 1); } else {