Merge pull request #5010 from Unity-Technologies/boehm-gc-alloc-fixed-sre
[mono.git] / mono / mini / debugger-agent.c
index 1a4940a82cc1fabd67952e792b27ff8bbf1f7ee8..88b1b18b68b8e0492dc328d8b4347d14843a43b8 100644 (file)
@@ -275,7 +275,7 @@ typedef struct {
 #define HEADER_LENGTH 11
 
 #define MAJOR_VERSION 2
-#define MINOR_VERSION 46
+#define MINOR_VERSION 45
 
 typedef enum {
        CMD_SET_VM = 1,
@@ -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];
+                       }
                }
        }
 
@@ -9057,14 +9063,6 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
                                        buffer_add_int (buf, locals->code_blocks [i].end_offset - locals->code_blocks [i].start_offset);
                                        last_start = locals->code_blocks [i].start_offset;
                                }
-                               if (CHECK_PROTOCOL_VERSION (2, 46)) {
-                                       /* Scopes for hoisted locals */
-                                       buffer_add_int (buf, locals->num_hoisted);
-                                       for (i = 0; i < locals->num_hoisted; ++i) {
-                                               buffer_add_int (buf, locals->code_blocks [i].start_offset);
-                                               buffer_add_int (buf, locals->code_blocks [i].end_offset);
-                                       }
-                               }
                        }
 
                        num_locals = locals->num_locals;