From: Jay Krell Date: Fri, 16 Aug 2019 13:33:04 +0000 (-0700) Subject: Ignore NULL in mono_marshal_free_dynamic_wrappers and mono_free_method. (mono/mono... X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~760 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e20cabd277d64d9b6bb0f37accdbd3313ef504c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Ignore NULL in mono_marshal_free_dynamic_wrappers and mono_free_method. (mono/mono#14150) Commit migrated from https://github.com/mono/mono/commit/e54f03168d223debdab1717eb24055662211e4f8 --- diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index c8d20fa..e093615 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -2194,6 +2194,9 @@ mono_get_method_constrained_checked (MonoImage *image, guint32 token, MonoClass void mono_free_method (MonoMethod *method) { + if (!method) + return; + MONO_PROFILER_RAISE (method_free, (method)); /* FIXME: This hack will go away when the profiler will support freeing methods */ diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index ae80fff..2099318 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -6338,6 +6338,9 @@ clear_runtime_invoke_method_cache (GHashTable *table, MonoMethod *method) void mono_marshal_free_dynamic_wrappers (MonoMethod *method) { + if (!method) + return; + MonoImage *image = get_method_image (method); g_assert (method_is_dynamic (method));