diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index f310f7364f5d88..767327c0fa42c9 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -12704,16 +12704,31 @@ mono_llvm_check_method_supported (MonoCompile *cfg) { #ifdef TARGET_WASM if (mono_method_signature_internal (cfg->method)->call_convention == MONO_CALL_VARARG) { + mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR); cfg->exception_message = g_strdup ("vararg callconv"); cfg->disable_llvm = TRUE; return; } if (mono_method_signature_internal (cfg->method)->param_count >= 1000 - 10) { + mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR); cfg->exception_message = g_strdup ("param count"); cfg->disable_llvm = TRUE; return; } + + // workaround for https://github.com/dotnet/runtime/issues/117557 + MonoClass *klass = cfg->method->klass; + if(klass->nested_in + && !strcmp(m_class_get_name_space (klass->nested_in), "System.Text.RegularExpressions.Symbolic") + && !strcmp(m_class_get_name (klass->nested_in), "SymbolicRegexBuilder`1") + && !strcmp(m_class_get_name (klass), "NodeCacheKey") + && !strcmp(cfg->method->name, "Equals")) { + mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); + cfg->exception_message = g_strdup ("too complex"); + cfg->disable_llvm = TRUE; + return; + } #endif if (cfg->llvm_only) diff --git a/src/mono/mono/mini/mini.c b/src/mono/mono/mini/mini.c index 6c8bb702be93d1..502a41a17a80a3 100644 --- a/src/mono/mono/mini/mini.c +++ b/src/mono/mono/mini/mini.c @@ -3319,7 +3319,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts error_init (cfg->error); if (cfg->compile_aot && !try_generic_shared && (method->is_generic || mono_class_is_gtd (method->klass) || method_is_gshared)) { - cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED; + mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); return cfg; }