[Mono-bugs] [Bug 31814][Nor] New - exception raised when compiling code that includes a print of an unsafe pointer

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
6 Oct 2002 03:07:19 -0000


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 vladimir@pobox.com.

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

--- shadow/31814	Sat Oct  5 23:07:19 2002
+++ shadow/31814.tmp.6173	Sat Oct  5 23:07:19 2002
@@ -0,0 +1,62 @@
+Bug#: 31814
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: exception raised when compiling code that includes a print of an unsafe pointer
+
+Compiling:
+
+/** startcode **/
+using System;
+
+public class Driver {
+        static unsafe int *fp;
+        public static void Frob () {
+                unsafe {
+                        string s = "fp: " + fp;
+                }
+        }
+
+        public static void Main (string[] args) {
+                Frob ();
+        }
+}
+/** endcode **/
+
+raises the following exception in mcs:
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required
+in <0x00039> 00 Mono.CSharp.Binary:Emit (Mono.CSharp.EmitContext)
+in <0x0017a> 00 Mono.CSharp.Argument:Emit (Mono.CSharp.EmitContext)
+in <0x00281> 00 Mono.CSharp.Invocation:EmitArguments
+(Mono.CSharp.EmitContext,System.Reflection.MethodBase,System.Collections.ArrayList)
+in <0x003bc> 00 Mono.CSharp.Invocation:EmitCall
+(Mono.CSharp.EmitContext,bool,bool,Mono.CSharp.Expression,System.Reflection.MethodBase,System.Collections.ArrayList,Mono.CSharp.Location)
+in <0x0009d> 00 Mono.CSharp.Invocation:Emit (Mono.CSharp.EmitContext)
+in <0x0001c> 00 Mono.CSharp.Invocation:EmitStatement (Mono.CSharp.EmitContext)
+in <0x00086> 00 Mono.CSharp.StatementExpression:Emit (Mono.CSharp.EmitContext)
+in <0x00416> 00 Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x0002c> 00 Mono.CSharp.Unsafe:Emit (Mono.CSharp.EmitContext)
+in <0x00416> 00 Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x001a3> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x005c5> 00 Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in <0x0001f> 00 Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x0027b> 00 Mono.CSharp.TypeContainer:Emit ()
+in <0x004da> 00 Mono.CSharp.RootContext:EmitCode ()
+in <0x00732> 00 Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000b> 00 Mono.CSharp.Driver:Main (string[])