From: Rahul Kumar Date: Wed, 12 Apr 2017 23:13:04 +0000 (-0700) Subject: HelperMethodFrame missing at certain places in method MarshalNative::PtrToStructureHelper X-Git-Tag: submit/tizen/20210909.063632~11030^2~7278^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f5017944ed39aebe4b80c2a4d0d114ab33caebb7;p=platform%2Fupstream%2Fdotnet%2Fruntime.git HelperMethodFrame missing at certain places in method MarshalNative::PtrToStructureHelper Commit migrated from https://github.com/dotnet/coreclr/commit/c5e9a125bb1fec179720973139211b4f14bc6bd5 --- diff --git a/src/coreclr/src/vm/marshalnative.cpp b/src/coreclr/src/vm/marshalnative.cpp index 8f1b23a..7e1d63b 100644 --- a/src/coreclr/src/vm/marshalnative.cpp +++ b/src/coreclr/src/vm/marshalnative.cpp @@ -183,11 +183,13 @@ FCIMPL3(VOID, MarshalNative::PtrToStructureHelper, LPVOID ptr, Object* pObjIn, C CONTRACTL_END; OBJECTREF pObj = ObjectToOBJECTREF(pObjIn); + + HELPER_METHOD_FRAME_BEGIN_1(pObj); if (ptr == NULL) - FCThrowArgumentNullVoid(W("ptr")); + COMPlusThrowArgumentNull(W("ptr")); if (pObj == NULL) - FCThrowArgumentNullVoid(W("structure")); + COMPlusThrowArgumentNull(W("structure")); // Code path will accept regular layout objects. MethodTable *pMT = pObj->GetMethodTable(); @@ -195,7 +197,7 @@ FCIMPL3(VOID, MarshalNative::PtrToStructureHelper, LPVOID ptr, Object* pObjIn, C // Validate that the object passed in is not a value class. if (!allowValueClasses && pMT->IsValueType()) { - FCThrowArgumentVoid(W("structure"), W("Argument_StructMustNotBeValueClass")); + COMPlusThrowArgumentException(W("structure"), W("Argument_StructMustNotBeValueClass")); } else if (pMT->IsBlittable()) { @@ -203,14 +205,14 @@ FCIMPL3(VOID, MarshalNative::PtrToStructureHelper, LPVOID ptr, Object* pObjIn, C } else if (pMT->HasLayout()) { - HELPER_METHOD_FRAME_BEGIN_1(pObj); - LayoutUpdateCLR((LPVOID*) &(pObj), Object::GetOffsetOfFirstField(), pMT, (LPBYTE)(ptr)); - HELPER_METHOD_FRAME_END(); + LayoutUpdateCLR((LPVOID*) &(pObj), Object::GetOffsetOfFirstField(), pMT, (LPBYTE)(ptr)); } else { - FCThrowArgumentVoid(W("structure"), W("Argument_MustHaveLayoutOrBeBlittable")); - } + COMPlusThrowArgumentException(W("structure"), W("Argument_MustHaveLayoutOrBeBlittable")); + } + + HELPER_METHOD_FRAME_END(); } FCIMPLEND