[Mono-bugs] [Bug 56207][Min] New - mcs crash when compiling string concat with pointer type

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 30 Mar 2004 02:24:04 -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 vladimir@pobox.com.

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

--- shadow/56207	2004-03-30 02:24:04.000000000 -0500
+++ shadow/56207.tmp.966	2004-03-30 02:24:04.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 56207
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs crash when compiling string concat with pointer type
+
+mono/mcs as of CVS 29 Mar 2004.  mcs output follows code.  Note that if the
+WriteLine is changed to just WriteLine(fp) then mcs issues an error message
+appropriately.
+
+==== bug23.cs ====
+using System;
+public class Driver {
+  public static void Main () {
+    float [] floats = new float[1];
+    floats[0] = 1.0f;
+    unsafe {
+      fixed (float *fp = &floats[0]) {
+	Console.WriteLine ("foo" + fp);
+      }
+    }
+  }
+}
+
+==== Output ====
+vladimir@river[1010]% mcs /unsafe bug23.cs
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: bug23.cs: (6)
+                     Block being compiled: [bug23.cs: (10),bug23.cs: (12)]
+System.NullReferenceException: A null value was found where an object
+instance was required.
+	in StringConcat.Append (Mono.CSharp.EmitContext, Mono.CSharp.Expression)
+	in StringConcat..ctor (Mono.CSharp.EmitContext, Mono.CSharp.Location,
+Mono.CSharp.Expression, Mono.CSharp.Expression)
+	in Binary.ResolveOperator (Mono.CSharp.EmitContext)
+	in Binary.DoResolve (Mono.CSharp.EmitContext)
+	in Expression.Resolve (Mono.CSharp.EmitContext, Mono.CSharp.ResolveFlags)
+	in Expression.Resolve (Mono.CSharp.EmitContext)
+	in Argument.Resolve (Mono.CSharp.EmitContext, Mono.CSharp.Location)
+	in Invocation.DoResolve (Mono.CSharp.EmitContext)
+	in Expression.Resolve (Mono.CSharp.EmitContext, Mono.CSharp.ResolveFlags)
+	in Expression.Resolve (Mono.CSharp.EmitContext)
+	in ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext)
+	in StatementExpression.Resolve (Mono.CSharp.EmitContext)
+	in Block.Resolve (Mono.CSharp.EmitContext)
+	in Fixed.Resolve (Mono.CSharp.EmitContext)
+	in Block.Resolve (Mono.CSharp.EmitContext)
+	in Block.Resolve (Mono.CSharp.EmitContext)
+	in Unsafe.Resolve (Mono.CSharp.EmitContext)
+	in Block.Resolve (Mono.CSharp.EmitContext)
+	in EmitContext.EmitTopBlock (Mono.CSharp.Block,
+Mono.CSharp.InternalParameters, Mono.CSharp.Location)