Fix various compiler warnings (#5064)
[mono.git] / mono / mini / debugger-agent.c
index bfdddb37547e5dac5d9f4f094b1084d87b359826..0c1a63db2e7a23b506f0d83c35e1384b50f8e2fd 100644 (file)
@@ -4792,7 +4792,7 @@ set_set_notification_for_wait_completion_flag (StackFrame *frame)
 static MonoMethod* notify_debugger_of_wait_completion_method_cache = NULL;
 
 static MonoMethod*
-get_notify_debugger_of_wait_completion_method ()
+get_notify_debugger_of_wait_completion_method (void)
 {
        if (notify_debugger_of_wait_completion_method_cache != NULL)
                return notify_debugger_of_wait_completion_method_cache;
@@ -7096,11 +7096,17 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
                                args [i] = arg_buf [i];
                        }
                } else {
-                       arg_buf [i] = (guint8 *)g_alloca (mono_class_instance_size (mono_class_from_mono_type (sig->params [i])));
+                       MonoClass *arg_class = mono_class_from_mono_type (sig->params [i]);
+                       arg_buf [i] = (guint8 *)g_alloca (mono_class_instance_size (arg_class));
                        err = decode_value (sig->params [i], domain, arg_buf [i], p, &p, end);
                        if (err != ERR_NONE)
                                break;
-                       args [i] = arg_buf [i];
+                       if (mono_class_is_nullable (arg_class)) {
+                               args [i] = mono_nullable_box (arg_buf [i], arg_class, &error);
+                               mono_error_assert_ok (&error);
+                       } else {
+                               args [i] = arg_buf [i];
+                       }
                }
        }
 
@@ -7153,7 +7159,9 @@ do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, guint8
                if ((invoke->flags & INVOKE_FLAG_RETURN_OUT_ARGS) && CHECK_PROTOCOL_VERSION (2, 35))
                        out_args = TRUE;
                buffer_add_byte (buf, 1 + (out_this ? 2 : 0) + (out_args ? 4 : 0));
-               if (sig->ret->type == MONO_TYPE_VOID) {
+               if (m->string_ctor) {
+                       buffer_add_value (buf, &mono_get_string_class ()->byval_arg, &res, domain);
+               } else if (sig->ret->type == MONO_TYPE_VOID && !m->string_ctor) {
                        if (!strcmp (m->name, ".ctor")) {
                                if (!m->klass->valuetype)
                                        buffer_add_value (buf, &mono_defaults.object_class->byval_arg, &this_arg, domain);