Skip to content

Commit

Permalink
Fix GetHashCode implementation for InterproceduralState (#82431)
Browse files Browse the repository at this point in the history
This is a port of dotnet/linker#3163 to runtime repo.
  • Loading branch information
vitek-karas authored Feb 21, 2023
1 parent ff10999 commit 9507a9c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using ILLink.Shared;
using ILLink.Shared.DataFlow;
using Mono.Cecil;
using Mono.Cecil.Cil;
Expand Down Expand Up @@ -31,7 +32,7 @@ public bool Equals (InterproceduralState other)
public override bool Equals (object? obj)
=> obj is InterproceduralState state && Equals (state);

public override int GetHashCode () => base.GetHashCode ();
public override int GetHashCode () => HashUtils.Combine (MethodBodies.GetHashCode (), HoistedLocals.GetHashCode ());

public InterproceduralState Clone ()
=> new (MethodBodies.Clone (), HoistedLocals.Clone (), lattice);
Expand Down

0 comments on commit 9507a9c

Please sign in to comment.