**** Merged r49265 from MCS ****
authorMartin Baulig <martin@novell.com>
Mon, 5 Sep 2005 13:38:38 +0000 (13:38 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 5 Sep 2005 13:38:38 +0000 (13:38 -0000)
svn path=/trunk/mcs/; revision=49466

mcs/gmcs/ChangeLog
mcs/gmcs/attribute.cs

index e247572b0ff50cfd14ff7a14fd02d9d8c0486c38..66ff47e89c42ac6d12328c7ccd1057ef1bfb6d40 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
+
+       Fix #75945.
+       * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
+       specified, don't default to UnmanagedType.I4.
+
 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
 
        * expression.cs : conditional operator should check possibly
index 68b4df253d2709a382dd857ea83b5d8bb9b45e04..dc74addfa0eb2d07f9252d7edd17d216afa6987c 100644 (file)
@@ -957,6 +957,11 @@ namespace Mono.CSharp {
                        return null;
                }
 
+               //
+               // Theoretically, we can get rid of this, since FieldBuilder.SetCustomAttribute()
+               // and ParameterBuilder.SetCustomAttribute() are supposed to handle this attribute.
+               // However, we can't, since it appears that the .NET 1.1 SRE hangs when given a MarshalAsAttribute.
+               //
                public UnmanagedMarshal GetMarshal (Attributable attr)
                {
                        UnmanagedType UnmanagedType;
@@ -972,7 +977,7 @@ namespace Mono.CSharp {
                        }
 
                        object o = GetFieldValue ("ArraySubType");
-                       UnmanagedType array_sub_type = o == null ? UnmanagedType.I4 : (UnmanagedType) o;
+                       UnmanagedType array_sub_type = o == null ? (UnmanagedType) 0x50 /* NATIVE_MAX */ : (UnmanagedType) o;
                        
                        switch (UnmanagedType) {
                        case UnmanagedType.CustomMarshaler: {