Don't crash with SO for AdvSimd.IsSupported (#33761)
authorEgor Bogatov <egorbo@gmail.com>
Thu, 19 Mar 2020 22:29:59 +0000 (01:29 +0300)
committerGitHub <noreply@github.com>
Thu, 19 Mar 2020 22:29:59 +0000 (01:29 +0300)
src/mono/mono/mini/intrinsics.c

index aa59329..38b7150 100644 (file)
@@ -1927,10 +1927,10 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign
        }
 
 #ifdef ENABLE_NETCORE
-       // Return false for IsSupported for all types in System.Runtime.Intrinsics.X86 
-       // as we don't support them now
+       // Return false for IsSupported for all types in System.Runtime.Intrinsics.* 
+       // if it's not handled in mono_emit_simd_intrinsics
        if (in_corlib && 
-               !strcmp ("System.Runtime.Intrinsics.X86", cmethod_klass_name_space) && 
+               !strncmp ("System.Runtime.Intrinsics", cmethod_klass_name_space, 25) && 
                !strcmp (cmethod->name, "get_IsSupported")) {
                EMIT_NEW_ICONST (cfg, ins, 0);
                ins->type = STACK_I4;