2004-04-27 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 27 Apr 2004 21:25:18 +0000 (21:25 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 27 Apr 2004 21:25:18 +0000 (21:25 -0000)
* flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
just for returns).

svn path=/trunk/mcs/; revision=26086

mcs/mcs/ChangeLog
mcs/mcs/flowanalysis.cs

index 048c987a4a491e79fe47cd4d1338c84de7d01c0e..50900038a31a6afdf043e0286d42d3229476ddf3 100755 (executable)
@@ -1,3 +1,9 @@
+2004-04-27  Martin Baulig  <martin@ximian.com>
+
+       * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
+       a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
+       just for returns).
+
 2004-04-27  Martin Baulig  <martin@ximian.com>
 
        * statement.cs (Block.AddLabel): Also check for implicit blocks
index 901d13b5a02f48a0cecb91f2b3f4172b7ba33075..0a951b4ebf5adc933020440e96898feecd5d5104 100644 (file)
@@ -329,6 +329,12 @@ namespace Mono.CSharp
                                update ();
                        }
 
+                       public void SetThrowsSometimes ()
+                       {
+                               throws = FlowReturns.Sometimes;
+                               update ();
+                       }
+
                        public void SetBarrier ()
                        {
                                barrier = FlowReturns.Always;
@@ -637,6 +643,10 @@ namespace Mono.CSharp
                                                        // We're either finite or we may leave the loop.
                                                        new_r.SetReturnsSometimes ();
                                                }
+                                               if (new_r.Throws == FlowReturns.Always) {
+                                                       // We're either finite or we may leave the loop.
+                                                       new_r.SetThrowsSometimes ();
+                                               }
                                        }
                                } else if (branching.Type == BranchingType.Switch)
                                        new_r.ResetBreaks ();