[Mono-bugs] [Bug 40828][Wis] New - Error in Try causes exception in flow code.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 6 Apr 2003 04:16:46 -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 miguel@ximian.com.

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

--- shadow/40828	Sun Apr  6 04:16:46 2003
+++ shadow/40828.tmp.16217	Sun Apr  6 04:16:46 2003
@@ -0,0 +1,60 @@
+Bug#: 40828
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error in Try causes exception in flow code.
+
+The following program contains an error, but it makes the flow analysis
+code crash (throws an exception, because the state is unexepcted);
+
+
+class X {
+        public void TempAssembly (X[] xmlMappings) {
+            X x = new X();
+            try {
+
+                foreach (int mapping in xmlMappings)
+		;
+            }
+            finally {
+            }
+        }
+	
+	static void Main ()
+	{
+	}
+}
+
+This is the output:
+/tmp/fi.cs(8) error CS0030: Cannot convert type 'X' to 'int'
+Exception caught by the compiler while compiling:
+   Block that caused the problem begin at: /tmp/fi.cs: (4)
+                     Block being compiled: [/tmp/fi.cs: (4),/tmp/fi.cs: (13)]
+
+Unhandled Exception: System.NotSupportedException: Operation is not supported
+in <0x00040> 00 Mono.CSharp.FlowBranching:CreateSiblingForFinally ()
+in <0x005b7> 00 Mono.CSharp.Try:Resolve (Mono.CSharp.EmitContext)
+in <0x0025e> 00 Mono.CSharp.Block:Resolve (Mono.CSharp.EmitContext)
+in <0x0010b> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x00357> 00 Mono.CSharp.EmitContext:EmitTopBlock
+(Mono.CSharp.Block,Mono.CSharp.InternalParameters,Mono.CSharp.Location)
+in <0x0053a> 00 Mono.CSharp.MethodData:Emit
+(Mono.CSharp.TypeContainer,Mono.CSharp.Block,object)
+in <0x00023> 00 Mono.CSharp.Method:Emit (Mono.CSharp.TypeContainer)
+in <0x00297> 00 Mono.CSharp.TypeContainer:Emit ()
+in <0x004c8> 00 Mono.CSharp.RootContext:EmitCode ()
+in <0x0075d> 00 Mono.CSharp.Driver:MainDriver (string[])
+in <0x0000f> 00 Mono.CSharp.Driver:Main (string[])