Skip to content

Commit

Permalink
2010-02-28 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
	with static methods. Fixes #583817.

svn path=/branches/mono-2-6/mono/; revision=152620
  • Loading branch information
vargaz committed Feb 28, 2010
1 parent 5ffc2bc commit 56f1063
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,8 @@
2010-02-28 Zoltan Varga <vargaz@gmail.com>

* object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
with static methods. Fixes #583817.

2010-02-26 Zoltan Varga <vargaz@gmail.com>

* class.c (get_implicit_generic_array_interfaces): Fix the last change so
Expand Down
15 changes: 12 additions & 3 deletions mono/metadata/object.c
Expand Up @@ -1255,7 +1255,9 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer*
for (i = 0; i < klass->interface_offsets_count; ++i) {
MonoClass *iface = klass->interfaces_packed [i];
int interface_offset = klass->interface_offsets_packed [i];
int method_slot_in_interface;
int method_slot_in_interface, vt_slot;

vt_slot = interface_offset;
for (method_slot_in_interface = 0; method_slot_in_interface < iface->method.count; method_slot_in_interface++) {
MonoMethod *method;

Expand All @@ -1267,15 +1269,22 @@ build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer*
* add_imt_builder_entry anyway.
*/
method = mono_class_get_method_by_index (iface->generic_class->container_class, method_slot_in_interface);
if (mono_method_get_imt_slot (method) != slot_num)
if (mono_method_get_imt_slot (method) != slot_num) {
vt_slot ++;
continue;
}
}
method = mono_class_get_method_by_index (iface, method_slot_in_interface);
if (method->is_generic) {
has_generic_virtual = TRUE;
vt_slot ++;
continue;
}
add_imt_builder_entry (imt_builder, method, &imt_collisions_bitmap, interface_offset + method_slot_in_interface, slot_num);

if (!(method->flags & METHOD_ATTRIBUTE_STATIC)) {
add_imt_builder_entry (imt_builder, method, &imt_collisions_bitmap, vt_slot, slot_num);
vt_slot ++;
}
}
}
if (extra_interfaces) {
Expand Down

0 comments on commit 56f1063

Please sign in to comment.