提交 872ffb16 编写于 作者: J Jonghyun Park 提交者: Jan Kotas

Fix inconsistency between GetHasCode and Equals (dotnet/coreclr#13513)



Commit migrated from https://github.com/dotnet/coreclr/commit/8b7dcb5900392f9e30a8aaabe11c89d470178322
上级 ddc689d7
......@@ -452,6 +452,17 @@ public override sealed int GetHashCode()
if (IsUnmanagedFunctionPtr())
return ValueType.GetHashCodeOfPtr(_methodPtr) ^ ValueType.GetHashCodeOfPtr(_methodPtrAux);
if (_invocationCount != (IntPtr)0)
{
var t = _invocationList as Delegate;
if (t != null)
{
// this is a secure/wrapper delegate so we need to unwrap and check the inner one
return t.GetHashCode();
}
}
Object[] invocationList = _invocationList as Object[];
if (invocationList == null)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册