Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78057 --- shadow/78057 2006-04-09 06:24:47.000000000 -0400 +++ shadow/78057.tmp.4408 2006-04-09 06:24:47.000000000 -0400 @@ -0,0 +1,122 @@ +Bug#: 78057 +Product: Mono: Runtime +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: misc +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Runtime produces invalid blob for array attributes + +Please fill in this template when reporting a bug, unless you know what you +are doing. +Description of Problem: + + + +Steps to reproduce the problem: +1. + +using System; + +[AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface, +AllowMultiple = true)] +public class SimpleAttribute : Attribute { + + string name = null; + + public string MyNamedArg; + + private string secret; + + public SimpleAttribute (string name) + { + this.name = name; + } + + public string AnotherArg { + get { + return secret; + } + set { + secret = value; + } + } + + public object D; +} + +[Simple ("Fifth", D=new double[] { -1 })] +class Blah2 +{ +} + +public class Blah { + + public static int Main () + { + object o = (((SimpleAttribute)typeof(Blah2).GetCustomAttributes (typeof +(SimpleAttribute), false)[0]).D); + if (o.ToString () != "System.Double[]") + return 1; + + Console.WriteLine ("OK"); + return 0; + } +} + +2. run + + +Actual Results: + +No error on mono runtime + +The exception on MS runtime + +Unhandled Exception: System.Reflection.CustomAttributeFormatException: +Binary format of the specified custom attribute was invalid. + at System.Reflection.CustomAttribute.GetDataForPropertyOrField(Boolean& +isProperty, Object& value, Type& type, Boolean isLast) + at System.Reflection.CustomAttribute.GetObject() + at +System.Reflection.CustomAttribute.CheckConsistencyAndCreateArray(CustomAttribute +caItem, Type caType) + at System.Reflection.CustomAttribute.GetCustomAttributes(MemberInfo +member, Type caType, Boolean inherit) + at System.Reflection.CustomAttribute.GetCustomAttributes(Type type, Type +caType, Boolean inherit) + at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean +inherit) + at Blah.Main() + + +Expected Results: + +Consitent behaviour + +How often does this happen? + + +Additional Information: + +Here is the difference. + +mcs + mono corlib + + .custom instance void SimpleAttribute::.ctor(string) = ( 01 00 05 46 69 +66 74 68 01 00 53 51 01 44 1D 0D 01 00 00 00 0E FF ) + + +mcs + ms corlib + + .custom instance void SimpleAttribute::.ctor(string) = ( 01 00 05 46 69 +66 74 68 01 00 53 51 01 44 1D 0D 01 00 00 00 00 00 00 00 00 00 F0 BF ) _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
