Author: zoltan
Date: 2005-05-25 07:12:36 -0400 (Wed, 25 May 2005)
New Revision: 44989
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/icall.c
Log:
2005-05-25 Zoltan Varga <[EMAIL PROTECTED]>
* icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
the method is static. Fixes #75029.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2005-05-25 10:57:45 UTC (rev 44988)
+++ trunk/mono/mono/metadata/ChangeLog 2005-05-25 11:12:36 UTC (rev 44989)
@@ -1,3 +1,8 @@
+2005-05-25 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
+ the method is static. Fixes #75029.
+
2005-05-25 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* reflection.c: Update the table_idx field of method builders after
Modified: trunk/mono/mono/metadata/icall.c
===================================================================
--- trunk/mono/mono/metadata/icall.c 2005-05-25 10:57:45 UTC (rev 44988)
+++ trunk/mono/mono/metadata/icall.c 2005-05-25 11:12:36 UTC (rev 44989)
@@ -2345,15 +2345,17 @@
MONO_ARCH_SAVE_REGS;
- if (this) {
- if (!mono_object_isinst (this, m->klass))
+ if (!(m->flags & METHOD_ATTRIBUTE_STATIC)) {
+ if (this) {
+ if (!mono_object_isinst (this, m->klass))
+ mono_raise_exception (mono_exception_from_name
(mono_defaults.corlib, "System.Reflection", "TargetException"));
+ m = mono_object_get_virtual_method (this, m);
+ /* must pass the pointer to the value for valuetype
methods */
+ if (m->klass->valuetype)
+ obj = mono_object_unbox (this);
+ } else if (strcmp (m->name, ".ctor") && !m->wrapper_type)
mono_raise_exception (mono_exception_from_name
(mono_defaults.corlib, "System.Reflection", "TargetException"));
- m = mono_object_get_virtual_method (this, m);
- /* must pass the pointer to the value for valuetype methods */
- if (m->klass->valuetype)
- obj = mono_object_unbox (this);
- } else if (!(m->flags & METHOD_ATTRIBUTE_STATIC) && strcmp (m->name,
".ctor") && !m->wrapper_type)
- mono_raise_exception (mono_exception_from_name
(mono_defaults.corlib, "System.Reflection", "TargetException"));
+ }
pcount = params? mono_array_length (params): 0;
if (pcount != mono_method_signature (m)->param_count)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches