Skip to content

Commit

Permalink
[mono] Fix incorrect version comparison in loader (#76698)
Browse files Browse the repository at this point in the history
* Compare version components in the correct order in
  assembly_names_compare_versions

* Fixes #76664

Co-authored-by: Ulrich Weigand <[email protected]>
  • Loading branch information
github-actions[bot] and uweigand authored Oct 7, 2022
1 parent aafaffa commit 236f3a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mono/mono/metadata/assembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ mono_assembly_names_equal_flags (MonoAssemblyName *l, MonoAssemblyName *r, MonoA
* if \p r is a lower version than \p l, or zero if \p l and \p r are equal
* versions (comparing upto \p maxcomps components).
*
* Components are \c major, \c minor, \c revision, and \c build. \p maxcomps 1 means just compare
* Components are \c major, \c minor, \c build, and \c revision. \p maxcomps 1 means just compare
* majors. 2 means majors then minors. etc.
*/
static int
Expand All @@ -284,9 +284,9 @@ assembly_names_compare_versions (MonoAssemblyName *l, MonoAssemblyName *r, int m
++i;
CMP (minor);
++i;
CMP (revision);
++i;
CMP (build);
++i;
CMP (revision);
#undef CMP
return 0;
}
Expand Down

0 comments on commit 236f3a7

Please sign in to comment.