mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 14:50:26 +00:00
Don't crash if we don't have a process and need
to check for alternate manglings. llvm-svn: 238475
This commit is contained in:
parent
9aefa0c6b9
commit
235de0aed3
@ -237,21 +237,24 @@ IRForTarget::GetFunctionAddress (llvm::Function *fun,
|
||||
// For example, "std::basic_string<...>" has an alternate mangling scheme per
|
||||
// the Itanium C++ ABI.
|
||||
lldb::ProcessSP process_sp = m_data_allocator.GetTarget()->GetProcessSP();
|
||||
lldb_private::CPPLanguageRuntime *cpp_runtime = process_sp->GetCPPLanguageRuntime();
|
||||
if (cpp_runtime && cpp_runtime->GetAlternateManglings(name, alternates))
|
||||
if (process_sp)
|
||||
{
|
||||
for (size_t i = 0; i < alternates.size(); ++i)
|
||||
lldb_private::CPPLanguageRuntime *cpp_runtime = process_sp->GetCPPLanguageRuntime();
|
||||
if (cpp_runtime && cpp_runtime->GetAlternateManglings(name, alternates))
|
||||
{
|
||||
const lldb_private::ConstString &alternate_name = alternates[i];
|
||||
if (log)
|
||||
log->Printf("Looking up address of function \"%s\" with alternate name \"%s\"",
|
||||
name.GetCString(), alternate_name.GetCString());
|
||||
if ((found_it = m_decl_map->GetFunctionAddress (alternate_name, fun_addr)))
|
||||
for (size_t i = 0; i < alternates.size(); ++i)
|
||||
{
|
||||
const lldb_private::ConstString &alternate_name = alternates[i];
|
||||
if (log)
|
||||
log->Printf("Found address of function \"%s\" with alternate name \"%s\"",
|
||||
log->Printf("Looking up address of function \"%s\" with alternate name \"%s\"",
|
||||
name.GetCString(), alternate_name.GetCString());
|
||||
break;
|
||||
if ((found_it = m_decl_map->GetFunctionAddress (alternate_name, fun_addr)))
|
||||
{
|
||||
if (log)
|
||||
log->Printf("Found address of function \"%s\" with alternate name \"%s\"",
|
||||
name.GetCString(), alternate_name.GetCString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user