Tolerate a null parent pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-10-14 22:55:57 +00:00
parent 4d156d3a25
commit c05d8aa6db

View 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.