Avoid crash in InitializeNonZerothFrame if no module found

After r221575 TestCallStopAndContinue and TestCallThatRestarts started
crashing on FreeBSD with a null temporary_module_sp in
RegisterContextLLDB::InitializeNonZerothFrame().

llvm-svn: 221805
This commit is contained in:
Ed Maste 2014-11-12 18:49:54 +00:00
parent 0c9aa57a07
commit b5363110c7
1 changed files with 2 additions and 1 deletions

View File

@ -501,7 +501,8 @@ RegisterContextLLDB::InitializeNonZerothFrame()
uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
ModuleSP temporary_module_sp = temporary_pc.GetModule();
if (temporary_module_sp->ResolveSymbolContextForAddress (temporary_pc, resolve_scope, m_sym_ctx) & resolve_scope)
if (temporary_module_sp &&
temporary_module_sp->ResolveSymbolContextForAddress (temporary_pc, resolve_scope, m_sym_ctx) & resolve_scope)
{
if (m_sym_ctx.GetAddressRange (resolve_scope, 0, false, addr_range))
m_sym_ctx_valid = true;