Browse Source

#3075: Fix ILVariableEqualityComparer.GetHashCode

pull/3111/head
Siegfried Pammer 3 years ago
parent
commit
cef99dc140
  1. 8
      ICSharpCode.Decompiler/IL/ILVariable.cs

8
ICSharpCode.Decompiler/IL/ILVariable.cs

@ -652,9 +652,13 @@ namespace ICSharpCode.Decompiler.IL
public int GetHashCode(ILVariable obj) public int GetHashCode(ILVariable obj)
{ {
if (obj.Kind == VariableKind.StackSlot) if (obj.Kind is VariableKind.StackSlot or VariableKind.PatternLocal)
return obj.GetHashCode(); return obj.GetHashCode();
return (obj.Function, obj.Kind, obj.Index).GetHashCode(); if (obj.Index == null && obj.StateMachineField == null)
return obj.GetHashCode();
if (obj.Index != null)
return (obj.Function, obj.Kind, obj.Index).GetHashCode();
return (obj.Function, obj.Kind, obj.StateMachineField).GetHashCode();
} }
} }
} }

Loading…
Cancel
Save