Skip to content

Commit

Permalink
[mono] return false for AdvSimd.IsSupported and friends
Browse files Browse the repository at this point in the history
Fixes StackOverflow in dotnet/runtime#33749 (comment)
Intrinsify all `get_IsSupported` under `System.Runtime.Intrinsics*` to just `false` (except the sets we support, see mono_emit_simd_intrinsics).
  • Loading branch information
EgorBo committed Mar 19, 2020
1 parent 8ca4d3e commit adc9d0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mono/mini/intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit adc9d0a

Please sign in to comment.