[marshal] Assert if adding handles to an out or inout parameter of an icall.
authorAleksey Kliger <aleksey@xamarin.com>
Fri, 5 Aug 2016 19:07:54 +0000 (15:07 -0400)
committerAleksey Kliger <aleksey@xamarin.com>
Mon, 8 Aug 2016 16:50:19 +0000 (12:50 -0400)
Eventually should support this (System.RuntimeType.GetInterfaceMapData
could use it, for one) but for now just assert.

mono/metadata/marshal.c

index af999512b4315d3732e7c9497f59f23f1f19d613..d5a60ae47427eae1f809e0c2d2113fc48ab03cb7 100644 (file)
@@ -7783,8 +7783,11 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
 
                        ret->param_count = csig->param_count + 1;
                        ret->ret = csig->ret;
-                       for (int i = 0; i < csig->param_count; ++i)
+                       for (int i = 0; i < csig->param_count; ++i) {
+                               // FIXME: TODO implement handle wrapping for out and inout params.
+                               g_assert (!mono_signature_param_is_out (csig, i));
                                ret->params [i] = csig->params [i];
+                       }
                        ret->params [csig->param_count] = &mono_get_intptr_class ()->byval_arg;
                        call_sig = ret;
                }