[Mono-bugs] [Bug 52451][Nor] New - mono is unable to load assemblies with attributes containing arrays

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 8 Jan 2004 17:11:34 -0500 (EST)


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 vargaz@freemail.hu.

http://bugzilla.ximian.com/show_bug.cgi?id=52451

--- shadow/52451	2004-01-08 17:11:34.000000000 -0500
+++ shadow/52451.tmp.29489	2004-01-08 17:11:34.000000000 -0500
@@ -0,0 +1,49 @@
+Bug#: 52451
+Product: Mono/Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: misc
+AssignedTo: vargaz@freemail.hu                            
+ReportedBy: pcgod@gmx.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mono is unable to load assemblies with attributes containing arrays
+
+compile both files together with csc (mcs is currently unable to compile 
+the testcase, see #52429) and the run it on mono. it will crash with an 
+exception in mono_custom_attrs_construct.
+
+the problem is in mono/metadata/reflection.c in create_custom_attr. the 
+specs say there is the type of the array after the array type (0x1d) which 
+it not checked by the runtime.
+
+also attaching a patch which fixes the problem for me and it also fixes 
+customattributebuilder to emit the correct il code (but i'm not sure that 
+it uses the correct way to get the array type).
+
+additional information:
+i also wondered why data_type is checked for the value 0x55, according to 
+specs there is no type with that number (or i overlooked it), but the code 
+seems to be for the value for 0x50 (Type).
+
+------- Additional Comments From pcgod@gmx.net  2003-12-22 13:29 -------
+Created an attachment (id=6294)
+test.cs
+
+
+------- Additional Comments From pcgod@gmx.net  2003-12-22 13:30 -------
+Created an attachment (id=6295)
+XmlMemberArrayAttribute.cs
+
+
+------- Additional Comments From pcgod@gmx.net  2003-12-22 13:30 -------
+Created an attachment (id=6296)
+proposed patch
+