Skip to content

Commit

Permalink
BUGFIX: Consider fnptr signatures in SignatureComparer::GetHashCode. F…
Browse files Browse the repository at this point in the history
…ixes #551
  • Loading branch information
Washi1337 committed Apr 19, 2024
1 parent ce3274b commit 2f89321
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public int GetHashCode(TypeSignature obj)
case ElementType.Boxed:
return GetHashCode((BoxedTypeSignature) obj);
case ElementType.FnPtr:
return GetHashCode((FunctionPointerTypeSignature) obj);
case ElementType.Internal:
case ElementType.Modifier:
throw new NotSupportedException();
Expand Down Expand Up @@ -318,7 +319,7 @@ public bool Equals(FunctionPointerTypeSignature? x, FunctionPointerTypeSignature
/// <inheritdoc />
public int GetHashCode(FunctionPointerTypeSignature obj)
{
return obj.Signature.GetHashCode();
return (int) obj.ElementType << ElementTypeOffset ^ GetHashCode(obj.Signature);
}

/// <inheritdoc />
Expand Down

0 comments on commit 2f89321

Please sign in to comment.