Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MetadataProvider/SignatureTypeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public virtual IType GetPointerType(IType targetType)

public virtual IType GetByReferenceType(IType targetType)
{
var result = new PointerType(targetType);
var result = new PointerType(targetType, true);
return result;
}

Expand Down
10 changes: 7 additions & 3 deletions Model/Types/Types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,13 @@ public class PointerType : IReferenceType
public ISet<CustomAttribute> Attributes { get; private set; }
public IType TargetType { get; set; }

public PointerType(IType targetType)
public bool Managed { get; private set; }

public PointerType(IType targetType, bool managed = false)
{
this.TargetType = targetType;
this.Attributes = new HashSet<CustomAttribute>();
this.Managed = managed;
}

public TypeKind TypeKind
Expand All @@ -674,15 +677,16 @@ public override string ToString()

public override int GetHashCode()
{
return this.TargetType.GetHashCode();
return this.TargetType.GetHashCode() ^ this.Managed.GetHashCode();
}

public override bool Equals(object obj)
{
var other = obj as PointerType;

var result = other != null &&
this.TargetType.Equals(other.TargetType);
this.TargetType.Equals(other.TargetType) &&
this.Managed.Equals(other.Managed);

return result;
}
Expand Down