-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix FCall implementation collision on ARM64 #39810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FCall implementation collision on ARM64 #39810
Conversation
jkotas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
Just curious - how was this leading to COMException? |
|
also why is this arm64 specific? |
|
@jkotas @mangod9 Functions must be byte-to-byte identical to be folded by the linker, so it ultimately depends on the compiler whether the two functions below produce identical code in release builds ( FCIMPL2(VOID, DependentHandle::nSetPrimary, OBJECTHANDLE handle, Object *_primary)
{
FCALL_CONTRACT;
_ASSERTE(handle != NULL);
IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager();
mgr->StoreObjectInHandle(handle, _primary);
}
FCIMPLEND
FCIMPL2(VOID, MarshalNative::GCHandleInternalSet, OBJECTHANDLE handle, Object *obj)
{
FCALL_CONTRACT;
OBJECTREF objRef(obj);
StoreObjectInHandle(handle, objRef);
}
FCIMPLEND
inline void StoreObjectInHandle(OBJECTHANDLE handle, OBJECTREF object)
{
ValidateHandleAssignment(handle, object);
GCHandleUtilities::GetGCHandleManager()->StoreObjectInHandle(handle, OBJECTREFToObject(object));
} |
This reverts commit 811c8c7.
Should we change |
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.
Fixes #39701. Two FCalls,
DependentHandle::nSetPrimaryandMarshalNative::GCHandleInternalSet, had identical implementations, which led to a failure inECall::GetFCallImpl("Duplicate pImplementation entries found in reverse fcall table"). AddFCUnique()to make them different.