Bug 313434 (MONO52451) - mono is unable to load assemblies with attributes containing arrays
Summary: mono is unable to load assemblies with attributes containing arrays
Status: RESOLVED FIXED
Alias: MONO52451
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Zoltan Varga
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2003-12-22 20:28 UTC by . .
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
test.cs (742 bytes, text/plain)
2003-12-22 20:29 UTC, Thomas Wiest
Details
XmlMemberArrayAttribute.cs (1.29 KB, text/plain)
2003-12-22 20:30 UTC, Thomas Wiest
Details
proposed patch (1.15 KB, patch)
2003-12-22 20:30 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:22:37 UTC


---- Reported by pcgod@gmx.net 2003-12-22 13:28:34 MST ----

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:29 MST ----

Created an attachment (id=165369)
test.cs




---- Additional Comments From pcgod@gmx.net 2003-12-22 13:30:08 MST ----

Created an attachment (id=165370)
XmlMemberArrayAttribute.cs




---- Additional Comments From pcgod@gmx.net 2003-12-22 13:30:52 MST ----

Created an attachment (id=165371)
proposed patch




---- Additional Comments From vargaz@freemail.hu 2004-01-09 11:19:47 MST ----

Fixed in CVS. Thanks for the patch.

Imported an attachment (id=165369)
Imported an attachment (id=165370)
Imported an attachment (id=165371)