return true for IsDynamicCodeSupported when interpreter is available (#52422)
authorLarry Ewing <lewing@microsoft.com>
Fri, 7 May 2021 01:10:16 +0000 (20:10 -0500)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 01:10:16 +0000 (20:10 -0500)
src/mono/mono/mini/intrinsics.c

index 8d1f527..519bcfb 100644 (file)
@@ -1946,10 +1946,14 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
        if (in_corlib &&
                !strcmp ("System.Runtime.CompilerServices", cmethod_klass_name_space) &&
                !strcmp ("RuntimeFeature", cmethod_klass_name)) {
-               if (!strcmp (cmethod->name, "get_IsDynamicCodeSupported") || !strcmp (cmethod->name, "get_IsDynamicCodeCompiled")) {
+               if (!strcmp (cmethod->name, "get_IsDynamicCodeCompiled")) {
                        EMIT_NEW_ICONST (cfg, ins, cfg->full_aot ? 0 : 1);
                        ins->type = STACK_I4;
                        return ins;
+               } else if (!strcmp (cmethod->name, "get_IsDynamicCodeSupported")) {
+                       EMIT_NEW_ICONST (cfg, ins, cfg->full_aot ? (cfg->interp ? 1 : 0) : 1);
+                       ins->type = STACK_I4;
+                       return ins;
                }
        }