diff options
author | Yi Zhang (CLR) <yzha@microsoft.com> | 2016-04-19 00:32:10 -0700 |
---|---|---|
committer | Yi Zhang (CLR) <yzha@microsoft.com> | 2016-04-19 09:31:55 -0700 |
commit | baff60cd73a804e76362b2576926ff728c19c98f (patch) | |
tree | 24e566e53e1e86363cb78842a628c1a52797e0b2 /src | |
parent | 0a31fe90800bd45e3c3668483dbe27358864170e (diff) | |
download | coreclr-baff60cd73a804e76362b2576926ff728c19c98f.tar.gz coreclr-baff60cd73a804e76362b2576926ff728c19c98f.tar.bz2 coreclr-baff60cd73a804e76362b2576926ff728c19c98f.zip |
Fix SysV calling convention bug in interop. We need to treat delegate field (NFT_DELEGATE) as INTEGER (as per SysV spec) since it is marshaled as a function pointer, otherwise we would end up passing it via stack which would cause all sorts of badness. Same for SAFEHANDLE/CRITICALHANDLE. It's not clear to me what the right semantics for DATE/CURRENCY is but they are Windows-only types, so we probably don't care yet.
This fixes MarshalStructAsLayoutSeq test on mac/linux.
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/methodtable.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp index 056c7cb892..ce04b51076 100644 --- a/src/vm/methodtable.cpp +++ b/src/vm/methodtable.cpp @@ -2921,15 +2921,17 @@ bool MethodTable::ClassifyEightBytesWithNativeLayout(SystemVStructRegisterPassin case NFT_ANSICHAR: case NFT_WINBOOL: case NFT_CBOOL: + case NFT_DELEGATE: + case NFT_SAFEHANDLE: + case NFT_CRITICALHANDLE: fieldClassificationType = SystemVClassificationTypeInteger; break; - case NFT_DELEGATE: + // It's not clear what the right behavior for NTF_DECIMAL and NTF_DATE is + // But those two types would only make sense on windows. We can revisit this later case NFT_DECIMAL: case NFT_DATE: case NFT_ILLEGAL: - case NFT_SAFEHANDLE: - case NFT_CRITICALHANDLE: default: return false; } |