Author: raja
Date: 2006-05-23 06:39:14 -0400 (Tue, 23 May 2006)
New Revision: 60987
Added:
trunk/mcs/errors/cs0139-3.cs
trunk/mcs/errors/cs0139-4.cs
trunk/mcs/errors/cs0139-5.cs
trunk/mcs/errors/cs0139-6.cs
trunk/mcs/tests/test-519.cs
Modified:
trunk/mcs/errors/ChangeLog
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/flowanalysis.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/flowanalysis.cs
trunk/mcs/tests/ChangeLog
Log:
In mcs:
* flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
unreachable, skip it.
(FlowBranchingException.Merge): Always propagate jumps, even if
the finally block renders subsequent code unreachable.
In gmcs:
* flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
unreachable, skip it.
(FlowBranchingException.Merge): Always propagate jumps, even if
the finally block renders subsequent code unreachable.
In tests:
* test-519.cs: New test for compiler crash.
In errors:
* cs0139-3.cs, cs0139-4.cs, cs0139-5.cs, cs0139-6.cs: New
regression tests for 'break' and 'continue' inside a try block.
Modified: trunk/mcs/errors/ChangeLog
===================================================================
--- trunk/mcs/errors/ChangeLog 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/errors/ChangeLog 2006-05-23 10:39:14 UTC (rev 60987)
@@ -1,3 +1,8 @@
+2006-05-23 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * cs0139-3.cs, cs0139-4.cs, cs0139-5.cs, cs0139-6.cs: New
+ regression tests for 'break' and 'continue' inside a try block.
+
2006-05-18 Raja R Harinath <[EMAIL PROTECTED]>
* cs0162-6.cs, cs0162-7.cs: New tests for unreachable code.
Added: trunk/mcs/errors/cs0139-3.cs
===================================================================
--- trunk/mcs/errors/cs0139-3.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/errors/cs0139-3.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -0,0 +1,13 @@
+// cs0139-3.cs: No enclosing loop out of which to break or continue
+// Line: 8
+
+class Foo {
+ static void Main ()
+ {
+ try {
+ break;
+ } finally {
+ throw new System.Exception ();
+ }
+ }
+}
Property changes on: trunk/mcs/errors/cs0139-3.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/cs0139-4.cs
===================================================================
--- trunk/mcs/errors/cs0139-4.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/errors/cs0139-4.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -0,0 +1,14 @@
+// cs0139-4.cs: No enclosing loop out of which to break or continue
+// Line: 9
+
+class Foo {
+ static void Main ()
+ {
+ try {
+ } catch {
+ break;
+ } finally {
+ throw new System.Exception ();
+ }
+ }
+}
Property changes on: trunk/mcs/errors/cs0139-4.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/cs0139-5.cs
===================================================================
--- trunk/mcs/errors/cs0139-5.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/errors/cs0139-5.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -0,0 +1,13 @@
+// cs0139-5.cs: No enclosing loop out of which to break or continue
+// Line: 8
+
+class Foo {
+ static void Main ()
+ {
+ try {
+ continue;
+ } finally {
+ throw new System.Exception ();
+ }
+ }
+}
Property changes on: trunk/mcs/errors/cs0139-5.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
Added: trunk/mcs/errors/cs0139-6.cs
===================================================================
--- trunk/mcs/errors/cs0139-6.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/errors/cs0139-6.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -0,0 +1,14 @@
+// cs0139-6.cs: No enclosing loop out of which to break or continue
+// Line: 9
+
+class Foo {
+ static void Main ()
+ {
+ try {
+ } catch {
+ continue;
+ } finally {
+ throw new System.Exception ();
+ }
+ }
+}
Property changes on: trunk/mcs/errors/cs0139-6.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/gmcs/ChangeLog 2006-05-23 10:39:14 UTC (rev 60987)
@@ -1,3 +1,10 @@
+2006-05-23 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
+ unreachable, skip it.
+ (FlowBranchingException.Merge): Always propagate jumps, even if
+ the finally block renders subsequent code unreachable.
+
2006-05-18 Raja R Harinath <[EMAIL PROTECTED]>
Fix #77601
Modified: trunk/mcs/gmcs/flowanalysis.cs
===================================================================
--- trunk/mcs/gmcs/flowanalysis.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/gmcs/flowanalysis.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -543,6 +543,8 @@
for (UsageVector vector = o_vectors; vector !=
null; vector = vector.Next) {
Report.Debug (1, " MERGING BREAK
ORIGIN", vector);
+ if (vector.Reachability.IsUnreachable)
+ continue;
MyBitVector.And (ref locals,
vector.locals);
MyBitVector.And (ref parameters,
vector.parameters);
reachability.Meet (vector.Reachability);
@@ -1074,29 +1076,25 @@
for (UsageVector origin = break_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddBreakOrigin (origin,
origin.Location);
+ Parent.AddBreakOrigin (origin, origin.Location);
}
for (UsageVector origin = continue_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddContinueOrigin (origin,
origin.Location);
+ Parent.AddContinueOrigin (origin,
origin.Location);
}
for (UsageVector origin = return_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddReturnOrigin (origin,
origin.Location);
+ Parent.AddReturnOrigin (origin,
origin.Location);
}
for (GotoOrigin origin = goto_origins; origin != null;
origin = origin.Next) {
if (finally_vector != null)
origin.Vector.MergeChild
(finally_vector, false);
- if (!origin.Vector.Reachability.IsUnreachable)
- Parent.AddGotoOrigin (origin.Vector,
origin.GotoStmt);
+ Parent.AddGotoOrigin (origin.Vector,
origin.GotoStmt);
}
return vector;
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/mcs/ChangeLog 2006-05-23 10:39:14 UTC (rev 60987)
@@ -1,3 +1,10 @@
+2006-05-23 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
+ unreachable, skip it.
+ (FlowBranchingException.Merge): Always propagate jumps, even if
+ the finally block renders subsequent code unreachable.
+
2006-05-18 Raja R Harinath <[EMAIL PROTECTED]>
Fix #77601
Modified: trunk/mcs/mcs/flowanalysis.cs
===================================================================
--- trunk/mcs/mcs/flowanalysis.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/mcs/flowanalysis.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -543,6 +543,8 @@
for (UsageVector vector = o_vectors; vector !=
null; vector = vector.Next) {
Report.Debug (1, " MERGING BREAK
ORIGIN", vector);
+ if (vector.Reachability.IsUnreachable)
+ continue;
MyBitVector.And (ref locals,
vector.locals);
MyBitVector.And (ref parameters,
vector.parameters);
reachability.Meet (vector.Reachability);
@@ -1074,29 +1076,25 @@
for (UsageVector origin = break_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddBreakOrigin (origin,
origin.Location);
+ Parent.AddBreakOrigin (origin, origin.Location);
}
for (UsageVector origin = continue_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddContinueOrigin (origin,
origin.Location);
+ Parent.AddContinueOrigin (origin,
origin.Location);
}
for (UsageVector origin = return_origins; origin !=
null; origin = origin.Next) {
if (finally_vector != null)
origin.MergeChild (finally_vector,
false);
- if (!origin.Reachability.IsUnreachable)
- Parent.AddReturnOrigin (origin,
origin.Location);
+ Parent.AddReturnOrigin (origin,
origin.Location);
}
for (GotoOrigin origin = goto_origins; origin != null;
origin = origin.Next) {
if (finally_vector != null)
origin.Vector.MergeChild
(finally_vector, false);
- if (!origin.Vector.Reachability.IsUnreachable)
- Parent.AddGotoOrigin (origin.Vector,
origin.GotoStmt);
+ Parent.AddGotoOrigin (origin.Vector,
origin.GotoStmt);
}
return vector;
Modified: trunk/mcs/tests/ChangeLog
===================================================================
--- trunk/mcs/tests/ChangeLog 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/tests/ChangeLog 2006-05-23 10:39:14 UTC (rev 60987)
@@ -1,3 +1,7 @@
+2006-05-23 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * test-519.cs: New test for compiler crash.
+
2006-05-18 Raja R Harinath <[EMAIL PROTECTED]>
* test-518.cs: New test based on #77601.
Added: trunk/mcs/tests/test-519.cs
===================================================================
--- trunk/mcs/tests/test-519.cs 2006-05-23 10:36:55 UTC (rev 60986)
+++ trunk/mcs/tests/test-519.cs 2006-05-23 10:39:14 UTC (rev 60987)
@@ -0,0 +1,23 @@
+class Foo {
+ static int Main ()
+ {
+ try {
+ f ();
+ return 1;
+ } catch {
+ return 0;
+ }
+ }
+ static void f ()
+ {
+ try {
+ goto skip;
+ } catch {
+ goto skip;
+ } finally {
+ throw new System.Exception ();
+ }
+ skip:
+ ;
+ }
+}
Property changes on: trunk/mcs/tests/test-519.cs
___________________________________________________________________
Name: svn:mime-type
+ text/cpp
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches