aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-30 22:52:47 +0000
committerDevang Patel <dpatel@apple.com>2009-10-30 22:52:47 +0000
commit5e8e2d7ad9147f15898a5587fea053d05017a055 (patch)
treeb7bdfabdaf608192e8f47be04697fa4d86a75552 /lib/Analysis/DebugInfo.cpp
parentdac8bde235b92b28202fe64ada3695aedbb8bf6d (diff)
If string field is empty then return NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 1d340b907a..7bff11ec5b 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -84,8 +84,11 @@ DIDescriptor::getStringField(unsigned Elt) const {
return NULL;
if (Elt < DbgNode->getNumElements())
- if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode->getElement(Elt)))
+ if (MDString *MDS = dyn_cast_or_null<MDString>(DbgNode->getElement(Elt))) {
+ if (MDS->getLength() == 0)
+ return NULL;
return MDS->getString().data();
+ }
return NULL;
}