diff options
author | Martin Baulig <martin@novell.com> | 2003-02-23 21:38:52 +0300 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2003-02-23 21:38:52 +0300 |
commit | a32e55fb66936ccada8ff914727214491b23e7f5 (patch) | |
tree | 25bcd4f76b7003eff3702573746fba08a0e0391b | |
parent | b056e2889accc8ac4e09e7844b6acfe0ea0b309a (diff) |
2003-02-23 Martin Baulig <martin@ximian.com>
* statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
svn path=/trunk/mcs/; revision=11874
-rwxr-xr-x | mcs/mcs/statement.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs index 061b2b936da..8d7376b0aae 100755 --- a/mcs/mcs/statement.cs +++ b/mcs/mcs/statement.cs @@ -1739,6 +1739,12 @@ namespace Mono.CSharp { } } + if ((branching.Type == FlowBranchingType.LOOP_BLOCK) && + branching.MayLeaveLoop && (new_returns == FlowReturns.ALWAYS)) { + Returns = FlowReturns.SOMETIMES; + return FlowReturns.SOMETIMES; + } + return new_returns; } @@ -2240,13 +2246,17 @@ namespace Mono.CSharp { default: // The code following a block or exception is reachable unless the // block either always returns or always breaks. - reachable = !CurrentUsageVector.AlwaysBreaks && - !CurrentUsageVector.AlwaysReturns; + if (MayLeaveLoop) + reachable = true; + else + reachable = !CurrentUsageVector.AlwaysBreaks && + !CurrentUsageVector.AlwaysReturns; break; } - Report.Debug (1, "REACHABLE", Type, CurrentUsageVector.Returns, - CurrentUsageVector.Breaks, CurrentUsageVector, reachable); + Report.Debug (1, "REACHABLE", this, Type, CurrentUsageVector.Returns, + CurrentUsageVector.Breaks, CurrentUsageVector, MayLeaveLoop, + reachable); return reachable; } |