[llvm-commits] [llvm] r85630 - /llvm/trunk/lib/Analysis/DebugInfo.cpp
Devang Patel
dpatel at apple.com
Fri Oct 30 15:52:47 PDT 2009
Author: dpatel
Date: Fri Oct 30 17:52:47 2009
New Revision: 85630
URL: http://llvm.org/viewvc/llvm-project?rev=85630&view=rev
Log:
If string field is empty then return NULL.
Modified:
llvm/trunk/lib/Analysis/DebugInfo.cpp
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=85630&r1=85629&r2=85630&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri Oct 30 17:52:47 2009
@@ -84,8 +84,11 @@
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;
}
More information about the llvm-commits
mailing list