[Mono-bugs] [Bug 63086][Min] New - Wrong flow analysis: Environment.Exit() does not return

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 14 Aug 2004 16:39:41 -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 kronos@people.it.

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

--- shadow/63086	2004-08-14 16:39:41.000000000 -0400
+++ shadow/63086.tmp.21982	2004-08-14 16:39:41.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 63086
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Minor
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: kronos@people.it               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Wrong flow analysis: Environment.Exit() does not return
+
+Description of Problem:
+
+mcs complains about un-initialized variables because it thinks that
+Environment.Exit() can return.
+
+Steps to reproduce the problem:
+
+kronos:/tmp$ cat test.cs
+using System;
+
+public class Test {
+        public void TestMe(bool condition) {
+	        string s;
+
+                if (condition)
+                        Environment.Exit(1);
+                else
+                        s = "foobar";
+                /* Use s */
+                s.Equals("foobar");
+        }
+}
+kronos:/tmp$ mcs test.cs
+test.cs(12) error CS0165: Use of unassigned local variable `s'
+Compilation failed: 1 error(s), 0 warnings
+kronos:/tmp$ mcs --version
+Mono C# compiler version 1.0.1.0