diff --git a/lib/Analysis/TypeBasedAliasAnalysis.cpp b/lib/Analysis/TypeBasedAliasAnalysis.cpp index 546991ea0e4..7955ab753a0 100644 --- a/lib/Analysis/TypeBasedAliasAnalysis.cpp +++ b/lib/Analysis/TypeBasedAliasAnalysis.cpp @@ -52,7 +52,7 @@ namespace { TBAANode getParent() const { if (Node->getNumOperands() < 2) return TBAANode(); - MDNode *P = dyn_cast(Node->getOperand(1)); + MDNode *P = dyn_cast_or_null(Node->getOperand(1)); if (!P) return TBAANode(); // Ok, this node has a valid parent. Return it.