From 811c8c7ffb244c098f22ac134ddb43bf3e152396 Mon Sep 17 00:00:00 2001 From: Anton Lapounov Date: Wed, 22 Jul 2020 21:17:42 -0700 Subject: [PATCH] Fix FCall implementation collision on ARM64 (#39810) Two FCalls, DependentHandle::nSetPrimary and MarshalNative::GCHandleInternalSet, had identical implementations, which led to a failure in ECall::GetFCallImpl ("Duplicate pImplementation entries found in reverse fcall table"). Add FCUnique() to make them different. --- src/coreclr/src/vm/comdependenthandle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/coreclr/src/vm/comdependenthandle.cpp b/src/coreclr/src/vm/comdependenthandle.cpp index 6144483..e261f16 100644 --- a/src/coreclr/src/vm/comdependenthandle.cpp +++ b/src/coreclr/src/vm/comdependenthandle.cpp @@ -86,6 +86,9 @@ FCIMPL2(VOID, DependentHandle::nSetPrimary, OBJECTHANDLE handle, Object *_primar _ASSERTE(handle != NULL); + // Avoid collision with MarshalNative::GCHandleInternalSet + FCUnique(0x12); + IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); mgr->StoreObjectInHandle(handle, _primary); } -- 2.7.4