From 4a2e93306b92959657b9e06ae15f9fba58cb7693 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 5 Oct 2022 12:44:46 +0200 Subject: [PATCH] [mono] Fix incorrect version comparison in loader * Compare version components in the correct order in assembly_names_compare_versions * Fixes https://github.com/dotnet/runtime/issues/76664 --- src/mono/mono/metadata/assembly.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index 43826b5a9236a..790adfc2f80b2 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -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 @@ -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; }