[Mono-bugs] [Bug 78679][Nor] New - "System.InvalidProgramException" on casting integers

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 20 18:49:16 EDT 2006

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 webmaster at deeem2031.de.


--- shadow/78679	2006-06-20 18:49:16.000000000 -0400
+++ shadow/78679.tmp.20667	2006-06-20 18:49:16.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 78679
+Product: Mono: Runtime
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: webmaster at deeem2031.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: "System.InvalidProgramException" on casting integers
+Description of Problem:
+If you try to cast integers to an object the mono.exe returns "Unhandled 
+Exception: System.InvalidProgramException: Invalid IL code in [...]: 
+castclass 0x01000002". Sure, this intend sounds wrong - but its supported 
+by the ms-framework and can be used to identify objects with integers. (e.
+g. you return a object in a procedure which has int32 as result und then 
+cast it back to the object in another procedure)
+Steps to reproduce the problem:
+1. Try to compile this code with ilasm.bat:
+.assembly extern mscorlib { }
+.assembly extern System { .publickeytoken = (B7 7A 5C 56 19 34 E0 89) .ver 
+1:0:5000:0 }
+.assembly tmp { }
+.module tmp.exe
+.subsystem 0x00000003
+.namespace PB {
+  .method public static void Exec() cil managed {
+    .entrypoint
+    ldc.i4.0
+    castclass class [System]System.Net.Sockets.NetworkStream
+    pop
+    ret
+  } //end of .method public static void Exec() cil managed
+} //end of .namespace PB
+2. start the exe with mono
+Actual Results:
+Unhandled Exception: System.InvalidProgramException: Invalid IL code in 
+:Exec (): IL_0007: castclass 0x01000002
+Expected Results:
+no error

More information about the mono-bugs mailing list