Procházet zdrojové kódy

Another minor fix to `OdinLLVMBuildTransmute`

gingerBill před 4 roky
rodič
revize
d3665331c7
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/llvm_backend.cpp

+ 1 - 1
src/llvm_backend.cpp

@@ -2878,7 +2878,7 @@ LLVMValueRef OdinLLVMBuildTransmute(lbProcedure *p, LLVMValueRef val, LLVMTypeRe
 		LLVMValueRef ptr = LLVMBuildAlloca(p->builder, dst_type, "");
 		LLVMValueRef ptr = LLVMBuildAlloca(p->builder, dst_type, "");
 		LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
 		LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
 		i64 max_align = gb_max(lb_alignof(src_type), lb_alignof(dst_type));
 		i64 max_align = gb_max(lb_alignof(src_type), lb_alignof(dst_type));
-		max_align = gb_max(max_align, 4);
+		max_align = gb_min(max_align, 4);
 		LLVMSetAlignment(ptr, cast(unsigned)max_align);
 		LLVMSetAlignment(ptr, cast(unsigned)max_align);
 
 
 		LLVMValueRef nptr = LLVMBuildPointerCast(p->builder, ptr, LLVMPointerType(src_type, 0), "");
 		LLVMValueRef nptr = LLVMBuildPointerCast(p->builder, ptr, LLVMPointerType(src_type, 0), "");