<rdar://problem/12524810>
Fixed a crasher where if an invalid SBTarget was passed to:
lldb::addr_t
SBAddress::GetLoadAddress (const SBTarget &target) const;
We would crash.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166439 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBAddress.cpp b/source/API/SBAddress.cpp
index 6013fd3..f3e0d78 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -119,10 +119,13 @@
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
TargetSP target_sp (target.GetSP());
- if (m_opaque_ap.get())
+ if (target_sp)
{
- Mutex::Locker api_locker (target_sp->GetAPIMutex());
- addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+ if (m_opaque_ap.get())
+ {
+ Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ addr = m_opaque_ap->GetLoadAddress (target_sp.get());
+ }
}
if (log)