[aot] Simplify a check to avoid calling into the assembly loading code while loading...
authorZoltan Varga <vargaz@gmail.com>
Wed, 21 Aug 2019 18:15:25 +0000 (14:15 -0400)
committerZoltan Varga <vargaz@gmail.com>
Wed, 21 Aug 2019 18:15:25 +0000 (14:15 -0400)
Fixes https://github.com/mono/mono/issues/16380.

Commit migrated from https://github.com/mono/mono/commit/c4de19ef097006408bbc52f489ec860b43cf8c17

src/mono/mono/mini/aot-runtime.c

index c20ed02..35495fe 100644 (file)
@@ -299,9 +299,7 @@ load_image (MonoAotModule *amodule, int index, MonoError *error)
         * current AOT module matches the wanted name and guid and just return
         * the AOT module's assembly.
         */
-       if (mono_asmctx_get_kind (&amodule->assembly->context) == MONO_ASMCTX_INDIVIDUAL &&
-           !strcmp (amodule->assembly->image->guid, amodule->image_guids [index]) &&
-           mono_assembly_names_equal (&amodule->image_names [index], &amodule->assembly->aname))
+       if (!strcmp (amodule->assembly->image->guid, amodule->image_guids [index]))
                assembly = amodule->assembly;
        else
                assembly = mono_assembly_load (&amodule->image_names [index], amodule->assembly->basedir, &status);