diff options
author | 2012-05-22 18:23:13 +0100 | |
---|---|---|
committer | 2012-05-22 18:23:13 +0100 | |
commit | 5ce14c595b3dca81d4cde68cafeebdfa43ec9d01 (patch) | |
tree | c7f0e315d17f6d4e17bd59b8c6136ca3173dd381 /Source/Graph | |
parent | 9e27f58fcaa894432abdde09df576e4959b58c8e (diff) |
Fix DomRelation.DominatedBy for the case where the dominator is the source
Diffstat (limited to 'Source/Graph')
-rw-r--r-- | Source/Graph/Graph.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Graph/Graph.cs b/Source/Graph/Graph.cs index 236baeb3..e5e8444c 100644 --- a/Source/Graph/Graph.cs +++ b/Source/Graph/Graph.cs @@ -99,12 +99,13 @@ namespace Graphing { if (domineeNum == dominatorNum)
return true;
int currentNodeNum = this.doms[domineeNum];
- do {
+ while (true) {
if (currentNodeNum == dominatorNum)
return true;
+ if (currentNodeNum == this.sourceNum)
+ return false;
currentNodeNum = this.doms[currentNodeNum];
- } while (currentNodeNum != this.sourceNum);
- return false;
+ }
}
private Dictionary<Node, List<Node>> domMap = null;
[Pure]
|