summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Analysis/Dominators.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h
index 9db52f608e5..f0d9a8e133c 100644
--- a/llvm/include/llvm/Analysis/Dominators.h
+++ b/llvm/include/llvm/Analysis/Dominators.h
@@ -311,6 +311,7 @@ public:
///
bool properlyDominates(const Node *N) const {
const Node *IDom;
+ if (this == 0 || N == 0) return false;
while ((IDom = N->getIDom()) != 0 && IDom != this)
N = IDom; // Walk up the tree
return IDom != 0;
OpenPOWER on IntegriCloud