From 29aa72f872510567becbe0d2c7e713c6061ff204 Mon Sep 17 00:00:00 2001 From: Alexander Corrado Date: Sun, 24 Jul 2011 04:23:52 -0400 Subject: [PATCH] FIXME: Managed override tramps need to support Itanium's return byval hidden argument --- src/Mono.Cxxi/Abi/Impl/ItaniumAbi.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mono.Cxxi/Abi/Impl/ItaniumAbi.cs b/src/Mono.Cxxi/Abi/Impl/ItaniumAbi.cs index 1669f911..3a4f7b98 100644 --- a/src/Mono.Cxxi/Abi/Impl/ItaniumAbi.cs +++ b/src/Mono.Cxxi/Abi/Impl/ItaniumAbi.cs @@ -64,6 +64,17 @@ namespace Mono.Cxxi.Abi { } } + internal override Delegate GetManagedOverrideTrampoline (CppTypeInfo typeInfo, int vtableIndex) + { + + // FIXME: HACK! we really need to support by val return types for managed override trampolines + if (typeInfo.VirtualMethods [vtableIndex] != null && + IsByVal (typeInfo.VirtualMethods [vtableIndex].OrigMethod.ReturnTypeCustomAttributes)) + return null; + + return base.GetManagedOverrideTrampoline (typeInfo, vtableIndex); + } + protected override MethodBuilder DefineMethod (CppTypeInfo typeInfo, PInvokeSignature sig, ref int vtableIndex) { var builder = base.DefineMethod (typeInfo, sig, ref vtableIndex);