From af74af2f4a01341fce78bcaac370d497f4f511b1 Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Mon, 16 Apr 2018 21:11:41 +0300 Subject: [x86/Linux] Fix marshalling struct with 64-bit types (#17455) * [x86/Linux] Fix marshalling struct with 64-bit types The System V ABI for i386 defines 4-byte alignment for 64-bit types. * [Linux/x86] Fix marshalling tests in the case of System V i386 ABI --- src/vm/fieldmarshaler.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vm/fieldmarshaler.h') diff --git a/src/vm/fieldmarshaler.h b/src/vm/fieldmarshaler.h index 8c1f8fe1ac..934f058f99 100644 --- a/src/vm/fieldmarshaler.h +++ b/src/vm/fieldmarshaler.h @@ -1626,7 +1626,13 @@ public: UNUSED_METHOD_IMPL(VOID UpdateNativeImpl(OBJECTREF* pCLRValue, LPVOID pNativeValue, OBJECTREF *ppCleanupWorkListOnStack) const) UNUSED_METHOD_IMPL(VOID UpdateCLRImpl(const VOID *pNativeValue, OBJECTREF *ppProtectedCLRValue, OBJECTREF *ppProtectedOldCLRValue) const) +#if defined(_TARGET_X86_) && defined(UNIX_X86_ABI) + // The System V ABI for i386 defines 4-byte alignment for 64-bit types. + SCALAR_MARSHALER_IMPL(8, 4) +#else SCALAR_MARSHALER_IMPL(8, 8) +#endif // _TARGET_X86_ + COPY_TO_IMPL_BASE_STRUCT_ONLY() VOID ScalarUpdateNativeImpl(LPVOID pCLR, LPVOID pNative) const -- cgit v1.2.3