diff options
author | Aaron Robinson <arobins@microsoft.com> | 2021-06-08 20:44:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-08 20:44:02 +0300 |
commit | aa558fa4a7e14c032d20ea3561d53415acb3ba21 (patch) | |
tree | 371f7d23b594d721da17bf7992cb29cd6e8c0a75 /src/coreclr/vm | |
parent | 77fb985f5e6ed282df7b8092e302dad9bd5f7955 (diff) |
Check if the marshalling of a field is possible across all platforms. (#53194)
* Check if the marshalling of a field is possible across all platforms.
* Add test for the generic field generation for IClassX.
Diffstat (limited to 'src/coreclr/vm')
-rw-r--r-- | src/coreclr/vm/comtoclrcall.cpp | 5 | ||||
-rw-r--r-- | src/coreclr/vm/mlinfo.h | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/coreclr/vm/comtoclrcall.cpp b/src/coreclr/vm/comtoclrcall.cpp index 30c5dc3bd9d..ca553e1e5ce 100644 --- a/src/coreclr/vm/comtoclrcall.cpp +++ b/src/coreclr/vm/comtoclrcall.cpp @@ -1013,7 +1013,6 @@ void ComCallMethodDesc::InitNativeInfo() CONSISTENCY_CHECK_MSGF(false, ("BreakOnComToClrNativeInfoInit: '%s' ", szDebugName)); #endif // _DEBUG -#ifdef TARGET_X86 MetaSig fsig(pFD); fsig.NextArg(); @@ -1030,6 +1029,10 @@ void ComCallMethodDesc::InitNativeInfo() #endif ); + if (info.GetMarshalType() == MarshalInfo::MARSHAL_TYPE_UNKNOWN) + info.ThrowTypeLoadExceptionForInvalidFieldMarshal(pFD, info.GetErrorResourceId()); + +#ifdef TARGET_X86 if (IsFieldGetter()) { // getter takes 'this' and the output argument by-ref diff --git a/src/coreclr/vm/mlinfo.h b/src/coreclr/vm/mlinfo.h index 68546b167c2..81fe67fdc2e 100644 --- a/src/coreclr/vm/mlinfo.h +++ b/src/coreclr/vm/mlinfo.h @@ -480,6 +480,12 @@ public: return m_ms == MarshalInfo::MARSHAL_SCENARIO_FIELD; } + UINT GetErrorResourceId() + { + LIMITED_METHOD_CONTRACT; + return m_resID; + } + private: UINT16 GetNativeSize(MarshalType mtype); |