summaryrefslogtreecommitdiff
path: root/src/vm/dllimport.cpp
diff options
context:
space:
mode:
authorHanjoung Lee <waterets@gmail.com>2017-03-16 12:29:34 +0900
committerJan Kotas <jkotas@microsoft.com>2017-03-15 20:29:34 -0700
commit9422f47c5de802d877c08f9f5118471b375239b1 (patch)
tree00aca1a8fa7d7969eaf641ca9b5baa36f770c8fc /src/vm/dllimport.cpp
parent60a73101ad8becbec2ad7d00b6451d135becc074 (diff)
downloadcoreclr-9422f47c5de802d877c08f9f5118471b375239b1.tar.gz
coreclr-9422f47c5de802d877c08f9f5118471b375239b1.tar.bz2
coreclr-9422f47c5de802d877c08f9f5118471b375239b1.zip
[x86/Linux] Fix IL_STUB_PInvoke with RetBuf (#10144)
* [x86/Linux] Fix IL_STUB_PInvoke with RetBuf Fix calling convention and IL_STUB_PInvoke for native functions which was problematic for native functions that has a RetBuf argument(struct size <= 8) on x86/Linux. Fix #10027
Diffstat (limited to 'src/vm/dllimport.cpp')
-rw-r--r--src/vm/dllimport.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index ba56831bd6..c0a73e8b80 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -3684,8 +3684,15 @@ static void CreateNDirectStubWorker(StubState* pss,
// return buffer in correct register.
// The return structure secret arg comes first, however byvalue return is processed at
// the end because it could be the HRESULT-swapped argument which always comes last.
+
+#ifdef UNIX_X86_ABI
+ // For functions with value type class, managed and unmanaged calling convention differ
+ fMarshalReturnValueFirst = HasRetBuffArgUnmanagedFixup(&msig);
+#else // UNIX_X86_ABI
fMarshalReturnValueFirst = HasRetBuffArg(&msig);
-#endif
+#endif // UNIX_X86_ABI
+
+#endif // defined(_TARGET_X86_) || defined(_TARGET_ARM_)
}