From 97023d377fbfeb6835a231a3bbe98cbab9b431df Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Thu, 11 Apr 2019 10:30:59 +0200 Subject: [PATCH] Do not crash the runtime in System.Reflection.Emit.ILGeneration tests (mono/mono#13917) Commit migrated from https://github.com/mono/mono/commit/a26f73dcd97f839bbddd7f8b9b1b121c7e2bb099 --- src/mono/mono/metadata/sre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/metadata/sre.c b/src/mono/mono/metadata/sre.c index 69fdb6f..f41437b 100644 --- a/src/mono/mono/metadata/sre.c +++ b/src/mono/mono/metadata/sre.c @@ -2319,7 +2319,8 @@ handle_type: *p++ = simple_type = klass_byval_arg->type; goto handle_enum; } else { - g_error ("unhandled type in custom attr"); + mono_error_set_not_supported (error, "unhandled type in custom attr"); + break; } str = type_get_qualified_name (m_class_get_byval_arg (klass), NULL); slen = strlen (str); @@ -2339,7 +2340,7 @@ handle_type: goto handle_enum; } default: - g_error ("type 0x%02x not yet supported in custom attr encoder", simple_type); + mono_error_set_not_supported (error, "type 0x%02x not yet supported in custom attr encoder", simple_type); } *retp = p; *retbuffer = buffer; -- 2.7.4