[mono][aot] Disable dedup for wrapper with a return type which has a cmod. (#80279)
authorZoltan Varga <vargaz@gmail.com>
Fri, 6 Jan 2023 05:32:27 +0000 (00:32 -0500)
committerGitHub <noreply@github.com>
Fri, 6 Jan 2023 05:32:27 +0000 (00:32 -0500)
The wrappers are not found at runtime in some cases.

Ref: https://github.com/dotnet/runtime/issues/79814.

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

index e21e263..cb502f8 100644 (file)
@@ -4453,6 +4453,11 @@ mono_aot_can_dedup (MonoMethod *method)
                        /* Handled using linkonce */
                        return FALSE;
 #endif
+               MonoMethodSignature *sig = mono_method_signature_internal (method);
+               if (sig->ret->has_cmods) {
+                       // FIXME:
+                       return FALSE;
+               }
                return TRUE;
        }
        default: