From: Jan Dupej <109523496+jandupej@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:09:20 +0000 (+0200) Subject: [mono] Expanding a marshaller error message (#88726) X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~1106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bcc188bcef478be5efff61f54f7a61bb487dfa0;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [mono] Expanding a marshaller error message (#88726) * Expanding error message in #46926 * Removing unnecessary code. --- diff --git a/src/mono/mono/metadata/marshal-lightweight.c b/src/mono/mono/metadata/marshal-lightweight.c index 8871b2f..dda7462 100644 --- a/src/mono/mono/metadata/marshal-lightweight.c +++ b/src/mono/mono/metadata/marshal-lightweight.c @@ -2504,7 +2504,11 @@ emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_s if (!sig->hasthis && sig->param_count != invoke_sig->param_count) { /* Closed delegate */ - g_assert (sig->param_count == invoke_sig->param_count + 1); + if (sig->param_count != invoke_sig->param_count + 1) { + g_warning ("Closed delegate has incorrect number of arguments: %s.", mono_method_full_name (method, TRUE)); + g_assert_not_reached (); + } + closed = TRUE; /* Use a new signature without the first argument */ sig = mono_metadata_signature_dup (sig);