Skip to content

Commit

Permalink
[mono] Fix sorting custom attributes in ILStrip (#88437)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
  • Loading branch information
github-actions[bot] and akoeplinger authored Jul 6, 2023
1 parent 2251e9f commit 671b932
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public int Compare(object left, object right)
{
CustomAttributeRow row_left = (CustomAttributeRow)left;
CustomAttributeRow row_right = (CustomAttributeRow)right;
return row_left.Parent.RID.CompareTo(row_right.Parent.RID);
var leftParentCodedIdx = Utilities.CompressMetadataToken(CodedIndex.HasCustomAttribute, row_left.Parent);
var rightParentCodedIdx = Utilities.CompressMetadataToken(CodedIndex.HasCustomAttribute, row_right.Parent);
return leftParentCodedIdx.CompareTo(rightParentCodedIdx);
}
}

Expand Down

0 comments on commit 671b932

Please sign in to comment.