Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Urban <bernhard.urban@xamarin.com>2017-02-27 19:55:53 +0300
committerBernhard Urban <bernhard.urban@xamarin.com>2017-03-01 00:59:28 +0300
commit02782549c3f8387cc4cb85ee407bc6808bbbcbda (patch)
treec5ae2f9f44885d11a18f19ddbd4167cc98952533
parent3f6f50317d821d746bf033c77e177aa81323b102 (diff)
[interpreter] inflate method signature for delegate.invoke ()
-rw-r--r--mono/mini/interpreter/transform.c6
-rw-r--r--mono/mini/objects.cs2
2 files changed, 6 insertions, 2 deletions
diff --git a/mono/mini/interpreter/transform.c b/mono/mini/interpreter/transform.c
index 5e4c1aaac4b..7aa65c5d0c1 100644
--- a/mono/mini/interpreter/transform.c
+++ b/mono/mini/interpreter/transform.c
@@ -692,6 +692,12 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
csignature = mono_method_signature (target_method);
}
+ /* TODO: that's oddly specific? */
+ if (generic_context && target_method && !strcmp ("Invoke", target_method->name) && target_method->klass->parent == mono_defaults.multicastdelegate_class) {
+ csignature = mono_inflate_generic_signature (csignature, generic_context, &error);
+ mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+ }
+
if (constrained_class) {
if (constrained_class->enumtype && !strcmp (target_method->name, "GetHashCode")) {
/* Use the corresponding method from the base type to avoid boxing */
diff --git a/mono/mini/objects.cs b/mono/mini/objects.cs
index 9cbbcd28f54..005e276fbb1 100644
--- a/mono/mini/objects.cs
+++ b/mono/mini/objects.cs
@@ -907,14 +907,12 @@ class Tests {
}
}
- [Category ("!INTERPRETER")]
public static int test_42_vtype_delegate () {
var s = new VtypeVirtualDelStruct () { f = 42 };
Func<int> f = s.return_field_nonvirt;
return f ();
}
- [Category ("!INTERPRETER")]
public static int test_42_vtype_virtual_delegate () {
IFaceVirtualDel s = new VtypeVirtualDelStruct () { f = 42 };
Func<int> f = s.return_field;