[Mono-bugs] [Bug 52486][Wis] New - Using at runtime generated enum's (with Reflection Emit) not possible

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 7 Jan 2004 09:28:49 -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=52486

--- shadow/52486	2004-01-07 09:28:49.000000000 -0500
+++ shadow/52486.tmp.8213	2004-01-07 09:28:49.000000000 -0500
@@ -0,0 +1,62 @@
+Bug#: 52486
+Product: Mono/Runtime
+Version: unspecified
+OS: SuSE 8.1
+OS Details: 
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Wishlist
+Component: misc
+AssignedTo: vargaz@freemail.hu                            
+ReportedBy: dominic_ullmann@hispeed.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Using at runtime generated enum's (with Reflection Emit) not possible
+
+Description of Problem:
+
+An enum gnerated at runtime with Reflection.Emit is not usable (before the 
+assembly has been saved to disk).
+
+After instantiating an enum, trying to print out the value results in the 
+following crash:
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+And trying to cast the enum to an int leads to the following exception:
+System.InvalidCastException: Cannot cast from source type to destination 
+type
+
+
+Steps to reproduce the problem:
+1. Compile and run the attachted file Test.cs
+
+Actual Results:
+- crash:
+
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+Expected Results:
+The demo should not crash. 
+It does work with csc/Microsoft.NET.
+
+How often does this happen? 
+every time.
+
+Additional Information:
+
+------- Additional Comments From dominic_ullmann@hispeed.ch  2003-12-23 11:37 -------
+Created an attachment (id=6302)
+Demo showing the problem
+
+
+------- Additional Comments From vargaz@freemail.hu  2004-01-07 09:28 -------
+Fixed in CVS.