Author: martin
Date: 2005-09-27 13:44:41 -0400 (Tue, 27 Sep 2005)
New Revision: 50879
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/loader.c
trunk/mono/mono/metadata/reflection.c
Log:
2005-09-27 Martin Baulig <[EMAIL PROTECTED]>
* reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
`k->byval_arg.type' to determine the actual type.
* loader.c (method_from_methodspec): Removed some hacks.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2005-09-27 17:17:11 UTC (rev 50878)
+++ trunk/mono/mono/metadata/ChangeLog 2005-09-27 17:44:41 UTC (rev 50879)
@@ -1,3 +1,10 @@
+2005-09-27 Martin Baulig <[EMAIL PROTECTED]>
+
+ * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
+ `k->byval_arg.type' to determine the actual type.
+
+ * loader.c (method_from_methodspec): Removed some hacks.
+
2005-09-27 Ben Maurer <[EMAIL PROTECTED]>
* class-internals.h (mono_field_is_deleted): Do the test for
Modified: trunk/mono/mono/metadata/loader.c
===================================================================
--- trunk/mono/mono/metadata/loader.c 2005-09-27 17:17:11 UTC (rev 50878)
+++ trunk/mono/mono/metadata/loader.c 2005-09-27 17:44:41 UTC (rev 50879)
@@ -654,19 +654,6 @@
method = mono_get_method_full (image, token, NULL, container);
method = mono_get_inflated_method (method);
- if (method->is_inflated)
- container = ((MonoMethodNormal *) ((MonoMethodInflated *)
method)->declaring)->generic_container;
- else
- container = ((MonoMethodNormal *) method)->generic_container;
- g_assert (container && container->is_method);
-
- if (context) {
- g_assert (context->container);
- container->parent = context->container;
- if (container->parent->is_method)
- container->parent = container->parent->parent;
- }
-
gmethod = g_new0 (MonoGenericMethod, 1);
gmethod->generic_class = method->klass->generic_class;
gmethod->container = container;
@@ -1082,11 +1069,6 @@
return mono_lookup_dynamic_token (image, token);
if (table != MONO_TABLE_METHOD) {
- MonoGenericContainer *generic_container = NULL;
- if (context) {
- g_assert (context->container);
- generic_container = context->container;
- }
if (table == MONO_TABLE_METHODSPEC)
return method_from_methodspec (image, context, idx);
if (table != MONO_TABLE_MEMBERREF)
Modified: trunk/mono/mono/metadata/reflection.c
===================================================================
--- trunk/mono/mono/metadata/reflection.c 2005-09-27 17:17:11 UTC (rev
50878)
+++ trunk/mono/mono/metadata/reflection.c 2005-09-27 17:44:41 UTC (rev
50879)
@@ -495,8 +495,11 @@
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS: {
MonoClass *k = mono_class_from_mono_type (type);
- mono_metadata_encode_value (type->type, p, &p);
/*
+ * Make sure we use the correct type.
+ */
+ mono_metadata_encode_value (k->byval_arg.type, p, &p);
+ /*
* ensure only non-byref gets passed to
mono_image_typedef_or_ref(),
* otherwise two typerefs could point to the same type, leading
to
* verification errors.
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches