diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-12-19 20:16:22 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-12-19 20:16:22 +0000 |
commit | 4efffd9ae5aa7bd00edb8f19f4cc895bd5213f5b (patch) | |
tree | 3f84bb3bd42aad6b6b665ddaceed185496386895 /lldb/source/API/SBModule.cpp | |
parent | 61221b72ee9ef0af516ec6387e0d1d21b3530734 (diff) | |
download | bcm5719-llvm-4efffd9ae5aa7bd00edb8f19f4cc895bd5213f5b.tar.gz bcm5719-llvm-4efffd9ae5aa7bd00edb8f19f4cc895bd5213f5b.zip |
Work in progress for:
rdar://problem/10577182
Audit lldb API impl for places where we need to perform a NULL check
Add NULL checks for SBModule and SBSection APIs.
llvm-svn: 146899
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index a42989757e1..c80d952e312 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -342,7 +342,7 @@ SBModule::FindFunctions (const char *name, { if (!append) sc_list.Clear(); - if (m_opaque_sp) + if (name && m_opaque_sp) { const bool symbols_ok = true; return m_opaque_sp->FindFunctions (ConstString(name), @@ -360,7 +360,7 @@ SBValueList SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_matches) { SBValueList sb_value_list; - if (m_opaque_sp) + if (name && m_opaque_sp) { VariableList variable_list; const uint32_t match_count = m_opaque_sp->FindGlobalVariables (ConstString (name), @@ -389,10 +389,10 @@ SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_ } lldb::SBType -SBModule::FindFirstType (const char* name_cstr) +SBModule::FindFirstType (const char *name_cstr) { SBType sb_type; - if (IsValid()) + if (name_cstr && IsValid()) { SymbolContext sc; TypeList type_list; @@ -413,12 +413,12 @@ SBModule::FindFirstType (const char* name_cstr) } lldb::SBTypeList -SBModule::FindTypes (const char* type) +SBModule::FindTypes (const char *type) { SBTypeList retval; - if (IsValid()) + if (type && IsValid()) { SymbolContext sc; TypeList type_list; @@ -449,7 +449,7 @@ SBModule::FindSection (const char *sect_name) { SBSection sb_section; - if (IsValid()) + if (sect_name && IsValid()) { ObjectFile *objfile = m_opaque_sp->GetObjectFile(); if (objfile) |