Author: raja
Date: 2005-04-05 05:29:43 -0400 (Tue, 05 Apr 2005)
New Revision: 42554
Added:
trunk/mcs/tests/test-360.cs
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/statement.cs
trunk/mcs/tests/ChangeLog
trunk/mcs/tests/Makefile
Log:
Fix #74041.
* mcs/statement.cs (Block.Resolve): Initialize 'unreachable' to false,
not 'unreachable_seen'.
* tests/test-360.cs: New test from #74041.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-04-05 09:25:59 UTC (rev 42553)
+++ trunk/mcs/mcs/ChangeLog 2005-04-05 09:29:43 UTC (rev 42554)
@@ -1,3 +1,9 @@
+2005-04-05 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #74041.
+ * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
+ not 'unreachable_seen'.
+
2005-04-04 Marek Safar <[EMAIL PROTECTED]>
* attribute.cs (Attribute.GetValue): Removed unused.
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2005-04-05 09:25:59 UTC (rev 42553)
+++ trunk/mcs/mcs/statement.cs 2005-04-05 09:29:43 UTC (rev 42554)
@@ -1931,7 +1931,13 @@
Report.Debug (4, "RESOLVE BLOCK", StartLocation,
ec.CurrentBranching);
- bool unreachable = unreachable_shown;
+ //
+ // This flag is used to notate nested statements as
unreachable from the beginning of this block.
+ // For the purposes of this resolution, it doesn't
matter that the whole block is unreachable
+ // from the beginning of the function. The outer
Resolve() that detected the unreachability is
+ // responsible for handling the situation.
+ //
+ bool unreachable = false;
int statement_count = statements.Count;
for (int ix = 0; ix < statement_count; ix++){
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2005-04-05 09:25:59 UTC (rev 42553)
+++ trunk/mcs/tests/ChangeLog 2005-04-05 09:29:43 UTC (rev 42554)
@@ -1,3 +1,7 @@
+2005-04-05 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * test-360.cs: New test from #74041.
+
2005-04-01 Kamil Skalski <[EMAIL PROTECTED]>
* test-359.cs: New test from #74309.
Modified: trunk/mcs/tests/Makefile
===================================================================
--- trunk/mcs/tests/Makefile 2005-04-05 09:25:59 UTC (rev 42553)
+++ trunk/mcs/tests/Makefile 2005-04-05 09:29:43 UTC (rev 42554)
@@ -31,7 +31,7 @@
NEW_TEST_SOURCES_common = xml-033 xml-034 xml-035 xml-036 test-329 2test-16
test-330 a-parameter5 test-331 test-332 \
test-333 test-311 test-335 test-336 test-337 test-287
test-338 test-339 test-341 test-334 test-342 \
test-344 test-345 test-346 test-347 test-348 test-349
test-350 test-351 test-352 test-353 test-354 test-355 \
- test-356 test-357 test-358 test-359 \
+ test-356 test-357 test-358 test-359 test-360 \
mtest-7-dll mtest-7-exe
#
Added: trunk/mcs/tests/test-360.cs
===================================================================
--- trunk/mcs/tests/test-360.cs 2005-04-05 09:25:59 UTC (rev 42553)
+++ trunk/mcs/tests/test-360.cs 2005-04-05 09:29:43 UTC (rev 42554)
@@ -0,0 +1,17 @@
+public class Application
+{
+ public static void Main(string[] args)
+ {
+ if (true)
+ {
+ string thisWorks = "nice";
+ System.Console.WriteLine(thisWorks);
+ }
+ else
+ {
+ string thisDoesnt = "not so";
+ System.Console.WriteLine(thisDoesnt);
+ }
+ }
+}
+
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches