From 2739cd108ce5783e00d4edd8b80ed64b5ef5de86 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Fri, 22 May 2009 00:19:54 +0200 Subject: [PATCH] Let TargetABI::passByValue() know when a parameter is byref (either explicitly or because it's a static array) by giving it the pointer type instead of the type itself. This fixes Derelict compilation on x86-64, where the ABI wasn't expecting a static array to be passed in at all. --- gen/functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index a006a6ff..03ba310a 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -145,7 +145,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest argtype = ltd; } // byval - else if (abi->passByVal(argtype)) + else if (abi->passByVal(byref ? argtype->pointerTo() : argtype)) { if (!byref) a |= llvm::Attribute::ByVal; byref = true;