[lldb] Quick Fix: IRExecutionUnit check pointer before access it

Summary:
Move checking pointer code block before accessing the pointer
This caused lldb to crash when testing on Android

Patch by Wanyi Ye!

Differential Revision: https://reviews.llvm.org/D64434

llvm-svn: 365567
This commit is contained in:
Alex Langford 2019-07-09 22:24:54 +00:00
parent 14a4495155
commit 269b9f940f
1 changed files with 3 additions and 3 deletions

View File

@ -285,9 +285,6 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
m_execution_engine_up.reset(builder.create(target_machine));
m_strip_underscore =
(m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');
if (!m_execution_engine_up) {
error.SetErrorToGenericError();
error.SetErrorStringWithFormat("Couldn't JIT the function: %s",
@ -295,6 +292,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
return;
}
m_strip_underscore =
(m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');
class ObjectDumper : public llvm::ObjectCache {
public:
void notifyObjectCompiled(const llvm::Module *module,