Skip to content

Commit

Permalink
[lldb] Quick Fix: IRExecutionUnit check pointer before access it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bulbazord committed Jul 9, 2019
1 parent 14a4495 commit 269b9f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lldb/source/Expression/IRExecutionUnit.cpp
Expand Up @@ -285,16 +285,16 @@ 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",
error_string.c_str());
return;
}

m_strip_underscore =
(m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');

class ObjectDumper : public llvm::ObjectCache {
public:
void notifyObjectCompiled(const llvm::Module *module,
Expand Down

0 comments on commit 269b9f9

Please sign in to comment.