projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a648cc
)
[bcl] Fix Delegate.GetHashCode () so it takes into account the target too. Fixes...
author
Zoltan Varga
<vargaz@gmail.com>
Wed, 2 Aug 2017 06:58:41 +0000
(
02:58
-0400)
committer
GitHub
<noreply@github.com>
Wed, 2 Aug 2017 06:58:41 +0000
(
02:58
-0400)
mcs/class/corlib/System/Delegate.cs
patch
|
blob
|
history
diff --git
a/mcs/class/corlib/System/Delegate.cs
b/mcs/class/corlib/System/Delegate.cs
index 4064ed9c90185ac0eec46c390977a61b4340a0f9..120991b2f79a9de061acadac90235eaa9d4b15fc 100644
(file)
--- a/
mcs/class/corlib/System/Delegate.cs
+++ b/
mcs/class/corlib/System/Delegate.cs
@@
-495,8
+495,11
@@
namespace System
public override int GetHashCode ()
{
- /* same implementation as CoreCLR */
- return GetType ().GetHashCode ();
+ MethodInfo m;
+
+ m = Method;
+
+ return (m != null ? m.GetHashCode () : GetType ().GetHashCode ()) ^ (m_target != null ? m_target.GetHashCode () : 0);
}
protected virtual MethodInfo GetMethodImpl ()