2007-10-05 Alp Toker <alp@atoker.com>
authorAlp Toker <alp@mono-cvs.ximian.com>
Fri, 5 Oct 2007 01:31:47 +0000 (01:31 -0000)
committerAlp Toker <alp@mono-cvs.ximian.com>
Fri, 5 Oct 2007 01:31:47 +0000 (01:31 -0000)
* icall.c (ves_icall_MonoType_GetElementType): For enums, return null
rather than the underlying type. Based on a patch by Ben Maurer. Fixes
#315863.

svn path=/trunk/mono/; revision=86944

mono/metadata/ChangeLog
mono/metadata/icall.c

index 77813ef53edd79d76750838971c589d2341b2cd2..0d2ca1fed953b3eb031a8d7e78f9960e467c15af 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-05  Alp Toker  <alp@atoker.com>
+
+       * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
+       rather than the underlying type. Based on a patch by Ben Maurer. Fixes
+       #315863.
+
 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
 
        * verify.c (verify_type_compatibility_full): verification of
index c3b45edd959bdb8213eeba6a010212413813e956..42fed637cd40509745b348831eb47fb043cbed1a 100644 (file)
@@ -1833,12 +1833,10 @@ ves_icall_MonoType_GetElementType (MonoReflectionType *type)
 
        MONO_ARCH_SAVE_REGS;
 
-       // GelElementType should only return a type for:
+       // GetElementType should only return a type for:
        // Array Pointer PassedByRef
        if (type->type->byref)
                return mono_type_get_object (mono_object_domain (type), &class->byval_arg);
-       if (class->enumtype && class->enum_basetype) /* types that are modifierd typebuilkders may not have enum_basetype set */
-               return mono_type_get_object (mono_object_domain (type), class->enum_basetype);
        else if (class->element_class && MONO_CLASS_IS_ARRAY (class))
                return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
        else if (class->element_class && type->type->type == MONO_TYPE_PTR)