diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-10-08 20:52:51 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-10-08 20:52:51 +0000 |
commit | 26c6cf4cecfffcb908cc6afe01d25fab5c88df43 (patch) | |
tree | 258fe4fbda56dc9f3bee88cf5774b0af33b35e22 /lib/Analysis/DebugInfo.cpp | |
parent | 632606c724ebcfa6a9da71c443151e7a65829c99 (diff) |
It's possible for a global variable to be optimized out of a metadata object. So
we should allow a "null" with this dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 1436aa909e..81d0ddb6f5 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -116,7 +116,7 @@ GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const { return 0; if (Elt < DbgNode->getNumElements()) - return dyn_cast<GlobalVariable>(DbgNode->getElement(Elt)); + return dyn_cast_or_null<GlobalVariable>(DbgNode->getElement(Elt)); return 0; } |