summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-12-14 01:43:31 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-12-14 01:43:31 +0000
commitc6770763e612f214422952998b6a8e3c3b3d97d1 (patch)
tree3f92a5758a8ca6f12f5c8dbc578e2e2ea6146927 /lldb/source/Core/Module.cpp
parent798b0c8340bf70f18ce07a0926f78eb0eb567fff (diff)
downloadbcm5719-llvm-c6770763e612f214422952998b6a8e3c3b3d97d1.tar.gz
bcm5719-llvm-c6770763e612f214422952998b6a8e3c3b3d97d1.zip
http://llvm.org/bugs/show_bug.cgi?id=11560 lldb::SBTarget::FindFirstType crashes when passed None
Add null checks to several functions. Plus add test scenario for passing None to SBTarget.FindFirstType(None) and friends. llvm-svn: 146540
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index cfe61efcfe6..ad5e3407d51 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -506,6 +506,9 @@ Module::FindTypes_Impl (const SymbolContext& sc, const ConstString &name, const
static const char*
StripTypeName(const char* name_cstr)
{
+ // Protect against null c string.
+ if (!name_cstr)
+ return name_cstr;
const char* skip_namespace = strstr(name_cstr, "::");
const char* template_arg_char = strchr(name_cstr, '<');
while (skip_namespace != NULL)
OpenPOWER on IntegriCloud