Author: raja
Date: 2005-05-13 05:06:07 -0400 (Fri, 13 May 2005)
New Revision: 44489
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/statement.cs
trunk/mcs/tests/Makefile
trunk/mcs/tests/test-360.cs
Log:
* statement.cs (Block.Resolve): Revert change below. Modify fix
for #74041 to initialize 'resolved' to false only for explicit
blocks. Fixes #74873.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-05-13 08:49:08 UTC (rev 44488)
+++ trunk/mcs/mcs/ChangeLog 2005-05-13 09:06:07 UTC (rev 44489)
@@ -1,3 +1,9 @@
+2005-05-13 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * statement.cs (Block.Resolve): Revert change below. Modify fix
+ for #74041 to initialize 'resolved' to false only for explicit
+ blocks. Fixes #74873.
+
2005-05-12 Raja R Harinath <[EMAIL PROTECTED]>
Fix #74920.
Modified: trunk/mcs/mcs/statement.cs
===================================================================
--- trunk/mcs/mcs/statement.cs 2005-05-13 08:49:08 UTC (rev 44488)
+++ trunk/mcs/mcs/statement.cs 2005-05-13 09:06:07 UTC (rev 44489)
@@ -1917,7 +1917,6 @@
}
bool unreachable_shown;
- bool unreachable;
public override bool Resolve (EmitContext ec)
{
@@ -1937,6 +1936,8 @@
// from the beginning of the function. The outer
Resolve() that detected the unreachability is
// responsible for handling the situation.
//
+ bool unreachable = Implicit ? unreachable_shown : false;
+
int statement_count = statements.Count;
for (int ix = 0; ix < statement_count; ix++){
Statement s = (Statement) statements [ix];
@@ -1953,8 +1954,10 @@
else
s.loc = Location.Null;
- if (ok && !(s is Block)) {
+ if (ok && !(s is Block && ((Block)
s).Implicit)) {
statements [ix] =
EmptyStatement.Value;
+ if (s is Block)
+ children.Remove (s);
continue;
}
}
@@ -2020,8 +2023,6 @@
if (Implicit)
return Resolve (ec);
- unreachable = true;
-
ec.StartFlowBranching
(FlowBranching.BranchingType.Block, loc);
bool ok = Resolve (ec);
ec.KillFlowBranching ();
Modified: trunk/mcs/tests/Makefile
===================================================================
--- trunk/mcs/tests/Makefile 2005-05-13 08:49:08 UTC (rev 44488)
+++ trunk/mcs/tests/Makefile 2005-05-13 09:06:07 UTC (rev 44489)
@@ -34,7 +34,7 @@
# He may also move some to TEST_EXCLUDE_net_2_0 if some of the merges are
inappropriate for GMCS.
#
NEW_TEST_SOURCES_common = test-336 test-369 cls-test-6 test-294 \
- test-372 test-375 test-376 test-377 test-378
+ test-372 test-375 test-376 test-377 test-378 test-360
#
# Please do _not_ add any tests here - all new tests should go into
NEW_TEST_SOURCES_common
@@ -78,7 +78,7 @@
test-321 test-323 test-324 test-325 test-326 test-327 test-328
test-329 test-330 \
test-331 test-332 test-333 test-334 test-335 test-337 test-338
test-339 test-340 \
test-341 test-342 test-343 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-360 \
+ test-351 test-352 test-353 test-354 test-355 test-356 test-357 test-358
test-359 \
test-361 test-362 test-363 test-364 test-365 test-366 test-367 test-368
test-370 \
test-371 test-373 test-374
test-379 \
cls-test-0 cls-test-1 cls-test-2 cls-test-3 cls-test-5 cls-test-7
cls-test-10 \
Modified: trunk/mcs/tests/test-360.cs
===================================================================
--- trunk/mcs/tests/test-360.cs 2005-05-13 08:49:08 UTC (rev 44488)
+++ trunk/mcs/tests/test-360.cs 2005-05-13 09:06:07 UTC (rev 44489)
@@ -9,8 +9,8 @@
}
else
{
- // string thisDoesnt = "not so";
- // System.Console.WriteLine(thisDoesnt);
+ string thisDoesnt = "not so";
+ System.Console.WriteLine(thisDoesnt);
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches