Tolerate a null parent pointer.
[oota-llvm.git] / lib / Analysis / TypeBasedAliasAnalysis.cpp
index 546991ea0e4af24493f48891a55ab755c527ac7c..7955ab753a007ea37777b009858d048fce29fbda 100644 (file)
@@ -52,7 +52,7 @@ namespace {
     TBAANode getParent() const {
       if (Node->getNumOperands() < 2)
         return TBAANode();
-      MDNode *P = dyn_cast<MDNode>(Node->getOperand(1));
+      MDNode *P = dyn_cast_or_null<MDNode>(Node->getOperand(1));
       if (!P)
         return TBAANode();
       // Ok, this node has a valid parent. Return it.