zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7c9a8ecc2aca7f925e59d282540ef8e2d1ae211e (tree)
parent e1dbb70bef002f049621a286dbb6a1b2e067af81
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Fri,  5 Aug 2022 18:59:46 -0700

stage1: another LLVM opaque pointers fix

Diffstat:
Msrc/stage1/codegen.cpp | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/stage1/codegen.cpp b/src/stage1/codegen.cpp @@ -2379,8 +2379,8 @@ static bool iter_function_params_c_abi(CodeGen *g, ZigType *fn_type, FnWalk *fn_ for (uint32_t i = 0; i < number_of_regs; i += 1) { LLVMValueRef adjusted_ptr_to_struct = LLVMBuildStructGEP2(g->builder, abi_type, abi_ptr_to_struct, i, ""); - LLVMValueRef loaded = LLVMBuildLoad2(g->builder, - ZigLLVMGetGEPResultElementType(adjusted_ptr_to_struct), + LLVMTypeRef field_llvm_ty = LLVMStructGetTypeAtIndex(abi_type, i); + LLVMValueRef loaded = LLVMBuildLoad2(g->builder, field_llvm_ty, adjusted_ptr_to_struct, ""); fn_walk->data.call.gen_param_values->append(loaded); }