Fix FCall implementation collision on ARM64 (#39810)
authorAnton Lapounov <antonl@microsoft.com>
Thu, 23 Jul 2020 04:17:42 +0000 (21:17 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Jul 2020 04:17:42 +0000 (21:17 -0700)
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

index 6144483..e261f16 100644 (file)
@@ -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);
 }