<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.

llvm-svn: 166439
This commit is contained in:
Greg Clayton 2012-10-22 20:49:35 +00:00
parent da031982b8
commit e4c1ef55ce
1 changed files with 6 additions and 3 deletions

View File

@ -119,10 +119,13 @@ SBAddress::GetLoadAddress (const SBTarget &target) const
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)