* class.c: do not insert non-virtual methods in the vtable.
* icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
that means the method is non-virtual. This never would have
happened before.
svn path=/trunk/mono/; revision=24443
+2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.c: do not insert non-virtual methods in the vtable.
+ * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
+ that means the method is non-virtual. This never would have
+ happened before.
+
2004-03-22 Lluis Sanchez Gual <lluis@ximian.com>
* profiler.c: Added lock for accessing coverage_hash.
MonoMethod *cm;
cm = class->methods [i];
-
- if (!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT) && (cm->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
+
+ /*
+ * Non-virtual method have no place in the vtable.
+ * This also catches static methods (since they are not virtual).
+ */
+ if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
+ continue;
+
+ /*
+ * If the method is REUSE_SLOT, we must check in the
+ * base class for a method to override.
+ */
+ if (!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT)) {
int slot = -1;
for (k = class->parent; k ; k = k->parent) {
int j;
}
match = 0;
- if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
- continue;
- g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+ if (method->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+ }
+
member = (MonoObject*)mono_method_get_object (domain, method, refklass);
l = g_slist_prepend (l, member);
continue;
}
- if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
- continue;
- g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), prop);
+ if (method->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), prop);
+ }
l = g_slist_prepend (l, mono_property_get_object (domain, startklass, prop));
len++;
if (method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME)
continue;
- if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
- continue;
- g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+
+ if (method->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+ }
if (method->flags & METHOD_ATTRIBUTE_STATIC) {
++num_static_methods;
if (!obj) {
obj = mono_object_new (mono_domain_get (), method->klass);
if (mono_object_class(obj) == mono_defaults.transparent_proxy_class) {
- method = mono_marshal_get_remoting_invoke (method->klass->vtable [method->slot]);
+ method = mono_marshal_get_remoting_invoke (method->slot == -1 ? method : method->klass->vtable [method->slot]);
}
}
mono_runtime_invoke (method, obj, pa, exc);