Skip to content

Commit

Permalink
2010-01-08 Rodrigo Kumpera <rkumpera@novell.com>
Browse files Browse the repository at this point in the history
	* icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.

svn path=/trunk/mono/; revision=149252
  • Loading branch information
kumpera committed Jan 8, 2010
1 parent 9ad9005 commit bcef7e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,7 @@
2010-01-08 Rodrigo Kumpera <rkumpera@novell.com>

* icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.

2010-01-08 Rodrigo Kumpera <rkumpera@novell.com>

* class.c (mono_class_is_assignable_from_slow): Support variant
Expand Down
9 changes: 4 additions & 5 deletions mono/metadata/icall.c
Expand Up @@ -2122,6 +2122,7 @@ ves_icall_Type_GetInterfaces (MonoReflectionType* type)
static void
ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType *iface, MonoArray **targets, MonoArray **methods)
{
gboolean variance_used;
MonoClass *class = mono_class_from_mono_type (type->type);
MonoClass *iclass = mono_class_from_mono_type (iface->type);
MonoReflectionMethod *member;
Expand All @@ -2134,13 +2135,11 @@ ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType

mono_class_setup_vtable (class);

/* type doesn't implement iface: the exception is thrown in managed code */
/*FIXME test for interfaces with variant generic arguments*/
if (! MONO_CLASS_IMPLEMENTS_INTERFACE (class, iclass->interface_id))
return;
ioffset = mono_class_interface_offset_with_variance (class, iclass, &variance_used);
if (ioffset == -1)
return;

len = mono_class_num_methods (iclass);
ioffset = mono_class_interface_offset (class, iclass);
domain = mono_object_domain (type);
mono_gc_wbarrier_generic_store (targets, (MonoObject*) mono_array_new (domain, mono_defaults.method_info_class, len));
mono_gc_wbarrier_generic_store (methods, (MonoObject*) mono_array_new (domain, mono_defaults.method_info_class, len));
Expand Down

0 comments on commit bcef7e0

Please sign in to comment.