diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 079e73d6e3cc..251faed96eb9 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -1088,7 +1088,7 @@ void ZigLLVMSetTailCall(LLVMValueRef Call) { void ZigLLVMSetCallSret(LLVMValueRef Call, LLVMTypeRef return_type) { CallInst *call_inst = unwrap(Call); Type *llvm_type = unwrap(return_type); - call_inst->addParamAttr(1, Attribute::getWithStructRetType(call_inst->getContext(), llvm_type)); + call_inst->addParamAttr(0, Attribute::getWithStructRetType(call_inst->getContext(), llvm_type)); } void ZigLLVMFunctionSetPrefixData(LLVMValueRef function, LLVMValueRef data) {