Merge pull request #2698 from esdrubal/iosxmlarray
[mono.git] / mono / metadata / remoting.c
index 9ab10c237bde3e877b127c0ed6dd6be21ee6a75b..9c329f4934247bb8218f87c7f518d48cca3e006a 100644 (file)
@@ -373,9 +373,10 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params)
                                        mparams[i] = *((gpointer *)params [i]);
                                } else {
                                        /* runtime_invoke expects a boxed instance */
-                                       if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i])))
-                                               mparams[i] = mono_nullable_box ((guint8 *)params [i], klass);
-                                       else
+                                       if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) {
+                                               mparams[i] = mono_nullable_box ((guint8 *)params [i], klass, &error);
+                                               mono_error_raise_exception (&error); /* FIXME don't raise here */
+                                       } else
                                                mparams[i] = params [i];
                                }
                        } else {
@@ -391,7 +392,8 @@ mono_remoting_wrapper (MonoMethod *method, gpointer *params)
 
        msg = mono_method_call_message_new (method, params, NULL, NULL, NULL);
 
-       res = mono_remoting_invoke ((MonoObject *)this_obj->rp, msg, &exc, &out_args);
+       res = mono_remoting_invoke ((MonoObject *)this_obj->rp, msg, &exc, &out_args, &error);
+       mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        if (exc)
                mono_raise_exception ((MonoException *)exc);
@@ -2008,7 +2010,10 @@ mono_marshal_xdomain_copy_value (MonoObject *val)
        case MONO_TYPE_U8:
        case MONO_TYPE_R4:
        case MONO_TYPE_R8: {
-               return mono_value_box (domain, mono_object_class (val), ((char*)val) + sizeof(MonoObject));
+               MonoObject *res = mono_value_box_checked (domain, mono_object_class (val), ((char*)val) + sizeof(MonoObject), &error);
+               mono_error_raise_exception (&error); /* FIXME don't raise here */
+               return res;
+
        }
        case MONO_TYPE_STRING: {
                MonoString *str = (MonoString *) val;