[Mono-bugs] [Bug 28292][Min] New - crash in mcs.exe when compiling incorrect code.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
28 Jul 2002 20:00:33 -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 rooneg@electricjellyfish.net.

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

--- shadow/28292	Sun Jul 28 16:00:33 2002
+++ shadow/28292.tmp.19717	Sun Jul 28 16:00:33 2002
@@ -0,0 +1,52 @@
+Bug#: 28292
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rooneg@electricjellyfish.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: crash in mcs.exe when compiling incorrect code.
+
+Trying to compile the following code:
+
+---- snip ----
+
+class Foo : System.Exception {
+  public void Main() {
+    throw Foo;
+  }
+}
+
+---- snip ----
+
+causes mcs 0.13 to throw an unhandled exception.  here's the backtrace.
+
+[rooneg@quicksilver:~ ] mcs bug.cs 
+
+** (process:66946): WARNING **: unhandled exception System.Exception:
+"Should never be called"
+in <0x00030> Mono.CSharp.TypeExpr:Emit (Mono.CSharp.EmitContext)
+in <0x000b1> Mono.CSharp.Throw:Emit (Mono.CSharp.EmitContext)
+in <0x00281> Mono.CSharp.Block:Emit (Mono.CSharp.EmitContext)
+in <0x000b5> Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.Location)
+in <0x00526> Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in <0x0001f> Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x00284> Mono.CSharp.TypeContainer:Emit ()
+in <0x004f5> Mono.CSharp.RootContext:EmitCode ()
+in <0x00753> Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000b> Mono.CSharp.Driver:Main (string[])
+
+[rooneg@quicksilver:~ ] 
+
+I concede that the code is incorrect, but the compiler should not crash.