diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-12-14 01:43:31 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-12-14 01:43:31 +0000 |
| commit | c6770763e612f214422952998b6a8e3c3b3d97d1 (patch) | |
| tree | 3f92a5758a8ca6f12f5c8dbc578e2e2ea6146927 /lldb/source/API/SBTarget.cpp | |
| parent | 798b0c8340bf70f18ce07a0926f78eb0eb567fff (diff) | |
| download | bcm5719-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/API/SBTarget.cpp')
| -rw-r--r-- | lldb/source/API/SBTarget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index e8a39a93aa0..179cb9372de 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -1188,7 +1188,7 @@ SBTarget::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->GetImages().FindFunctions (ConstString(name), @@ -1203,7 +1203,7 @@ SBTarget::FindFunctions (const char *name, lldb::SBType SBTarget::FindFirstType (const char* type) { - if (m_opaque_sp) + if (type && m_opaque_sp) { size_t count = m_opaque_sp->GetImages().GetSize(); for (size_t idx = 0; idx < count; idx++) @@ -1223,7 +1223,7 @@ SBTarget::FindTypes (const char* type) SBTypeList retval; - if (m_opaque_sp) + if (type && m_opaque_sp) { ModuleList& images = m_opaque_sp->GetImages(); ConstString name_const(type); @@ -1251,7 +1251,7 @@ SBTarget::FindGlobalVariables (const char *name, uint32_t max_matches) { SBValueList sb_value_list; - if (m_opaque_sp) + if (name && m_opaque_sp) { VariableList variable_list; const bool append = true; |

