[Mono-bugs] [Bug 47095][Min] New - Error with control-flow-analysis in functions with "out" parameters

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 30 Jul 2003 02:58:51 -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 poussine@freesurf.fr.

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

--- shadow/47095	Wed Jul 30 02:58:50 2003
+++ shadow/47095.tmp.11269	Wed Jul 30 02:58:51 2003
@@ -0,0 +1,65 @@
+Bug#: 47095
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: Windows 2000, .NET 1.1
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: poussine@freesurf.fr               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error with control-flow-analysis in functions with "out" parameters
+
+Description of Problem:
+Control-flow-analysis does not correctly handle "return" keyword 
+in "catch" statements.
+
+Steps to reproduce the problem:
+Compile the following file: 
+----- bug.cs -----
+class TestClass
+{
+  public static void Main()
+  {
+    int a;
+    method(out a);
+  }
+
+  public static bool method(out int a)
+  {
+    try
+    {
+      a = 0;
+      return true;
+    }
+    catch (System.Exception)
+    {
+      a = -1;
+      return false;
+    }
+  }
+}
+------------------
+
+Actual Results:
+Doesn't compile.
+mcs reports:
+>mcs bug.cs
+bug.cs(21) error CS0177: The out parameter `a' must be assigned before
+control leave the current method.
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+Compilation succeed 
+
+How often does this happen? 
+Always
+
+Additional Information:
+csc 1.1 success to compile the file