[Mono-bugs] [Bug 29993][Nor] New - mcs crashes when processing a catch clause with an undeclared exception

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
6 Sep 2002 23:48:52 -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 murban@mylinuxisp.com.

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

--- shadow/29993	Fri Sep  6 19:48:52 2002
+++ shadow/29993.tmp.17751	Fri Sep  6 19:48:52 2002
@@ -0,0 +1,73 @@
+Bug#: 29993
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: murban@mylinuxisp.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs crashes when processing a catch clause with an undeclared exception
+
+Description of Problem:       
+      
+mcs crashes with a System.NullReferenceException when processing a catch      
+clause where the exception has not been declared. I originally discovered 
+the bug when I misspelled the name of an exception.  
+       
+       
+Steps to reproduce the problem:       
+1.  Compile the program below with mcs      
+      
+using System;     
+     
+public class Testing     
+{     
+	public static void Main()     
+	{     
+		try     
+		{ ; }     
+		catch (MyException) {}     
+	}	     
+}     
+      
+       
+Actual Results:       
+    
+mcs aborts with the stack trace    
+    
+ Unhandled Exception: System.NullReferenceException: A null value was    
+found where an object instance was required    
+in <0x0008c> 00 Mono.CSharp.Catch:Resolve (Mono.CSharp.EmitContext)    
+in <0x00281> 00 Mono.CSharp.Try:Resolve (Mono.CSharp.EmitContext)    
+in <0x00118> 00 Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)    
+in <0x00100> 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 <0x004dd> 00 Mono.CSharp.RootContext:EmitCode ()    
+in <0x00732> 00 Mono.CSharp.Driver:MainDriver (string[])    
+in <0x0000b> 00 Mono.CSharp.Driver:Main (string[])    
+    
+     
+Expected Results:       
+    
+mcs reports `MyException' is not declared in the current scope   
+       
+  
+How often does this happen?        
+   
+Always    
+       
+Additional Information:       
+  
+Recent mcs from CVS today