[Mono-bugs] [Bug 47722][Wis] New - mcs crash with "o as Q" where o is unassigned

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 19 Aug 2003 03:04:16 -0400 (EDT)


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=47722

--- shadow/47722	2003-08-19 03:04:15.000000000 -0400
+++ shadow/47722.tmp.6012	2003-08-19 03:04:16.000000000 -0400
@@ -0,0 +1,66 @@
+Bug#: 47722
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs crash with "o as Q" where o is unassigned
+
+mono/cs as of 08/19, including 0.26, causes a crash inside mcs on the
+following code:
+
+
+---- test.cs ----
+public class Driver {
+  public static void Main () {
+    object o;
+    System.String q = o as System.String;
+  }
+}
+----- end -----
+
+The (I think?) correct error is reported, but a crash follows:
+
+vladimir@river[1038]% mcs crashTest.cs
+crashTest.cs(6) error CS0165: Use of unassigned local variable `o'
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: crashTest.cs: (3)
+                     Block being compiled: [crashTest.cs: (3),crashTest.cs:
+(7)]
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required
+in <0x0004f> 00 Mono.CSharp.As:DoResolve (Mono.CSharp.EmitContext)
+in <0x000e1> 00 Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in <0x00019> 00 Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext)
+in <0x000fc> 00 Mono.CSharp.Assign:DoResolve (Mono.CSharp.EmitContext)
+in <0x000e1> 00 Mono.CSharp.Expression:Resolve
+(Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags)
+in <0x00019> 00 Mono.CSharp.Expression:Resolve (Mono.CSharp.EmitContext)
+in <0x00022> 00 Mono.CSharp.ExpressionStatement:ResolveStatement
+(Mono.CSharp.EmitContext)
+in <0x0001d> 00 Mono.CSharp.StatementExpression:Resolve
+(Mono.CSharp.EmitContext)
+in <0x001ee> 00 Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)
+in <0x000ed> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x00277> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x0044e> 00 Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in <0x00038> 00 Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x00260> 00 Mono.CSharp.TypeContainer:Emit ()
+in <0x005c0> 00 Mono.CSharp.RootContext:EmitCode ()
+in <0x00838> 00 Mono.CSharp.Driver:MainDriver (string[])
+in <0x0001b> 00 Mono.CSharp.Driver:Main (string[])