summaryrefslogtreecommitdiff
path: root/Source/Core/AbsyExpr.cs
diff options
context:
space:
mode:
authorGravatar Dan Rosén <danr@chalmers.se>2014-08-01 10:10:27 -0700
committerGravatar Dan Rosén <danr@chalmers.se>2014-08-01 10:10:27 -0700
commitfcb95cb3964d4b9d5fa112c72f8971df77df7e0b (patch)
treecc6a56eefce797245d671a90c1d1eadc056d5a87 /Source/Core/AbsyExpr.cs
parenta32ac3bff9a24b812d133883fb9f8df5341b7bb9 (diff)
parenta645d5392e5d23c01fa17d543fc70f428794159c (diff)
Merge
Diffstat (limited to 'Source/Core/AbsyExpr.cs')
-rw-r--r--Source/Core/AbsyExpr.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/AbsyExpr.cs b/Source/Core/AbsyExpr.cs
index 7e71453b..33b3a818 100644
--- a/Source/Core/AbsyExpr.cs
+++ b/Source/Core/AbsyExpr.cs
@@ -2122,12 +2122,16 @@ namespace Microsoft.Boogie {
return false;
NAryExpr other = (NAryExpr)obj;
- return this.Args.ListEquals(other.Args) && object.Equals(this.Fun, other.Fun);
+ return object.Equals(this.Fun, other.Fun) && this.Args.SequenceEqual(other.Args);
}
[Pure]
public override int GetHashCode() {
int h = this.Fun.GetHashCode();
- h ^= this.Args.GetHashCode();
+ // DO NOT USE Args.GetHashCode() because that uses Object.GetHashCode() which uses references
+ // We want structural equality
+ foreach (var arg in Args) {
+ h = (97*h) + arg.GetHashCode();
+ }
return h;
}
public override void Emit(TokenTextWriter stream, int contextBindingStrength, bool fragileContext) {