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

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 23 Aug 2004 11:44:30 -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-22 18:01:20.000000000 -0400
+++ shadow/63086.tmp.17861	2004-08-23 11:44:30.000000000 -0400
@@ -43,6 +43,21 @@
 Compilation failed: 1 error(s), 0 warnings
 kronos:/tmp$ mcs --version
 Mono C# compiler version 1.0.1.0
 
 ------- Additional Comments From martin@ximian.com  2004-08-22 18:01 -------
 And where is the problem ... ?
+
+------- Additional Comments From kronos@people.it  2004-08-23 11:44 -------
+string s;
+
+if (condition)
+        Environment.Exit(1);
+else
+        s = "foobar";
+/* Use s */
+s.Equals("foobar");
+
+mcs complains about unassigned variable and do not compile. But if
+/condition/ is true then the program will exit and the variable won't
+be used at all. The error would be correct if Environment.Exit()
+returns but the function does not return!