Remove an assertion and replace with safe code that emits a warning.

llvm-svn: 133786
This commit is contained in:
Greg Clayton 2011-06-24 03:47:23 +00:00
parent 0c74e78d63
commit 17cc8b9d88
1 changed files with 13 additions and 2 deletions

View File

@ -305,8 +305,19 @@ Function::GetBlock (bool can_create)
{ {
SymbolContext sc; SymbolContext sc;
CalculateSymbolContext(&sc); CalculateSymbolContext(&sc);
assert(sc.module_sp); if (sc.module_sp)
sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc); {
sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc);
}
else
{
::fprintf (stderr,
"unable to find module shared pointer for function '%s' in %s%s%s\n",
GetName().GetCString(),
m_comp_unit->GetDirectory().GetCString(),
m_comp_unit->GetDirectory() ? "/" : "",
m_comp_unit->GetFilename().GetCString());
}
m_block.SetBlockInfoHasBeenParsed (true, true); m_block.SetBlockInfoHasBeenParsed (true, true);
} }
return m_block; return m_block;