Author: xiaobai Date: Tue Jul 9 15:24:54 2019 New Revision: 365567 URL: http://llvm.org/viewvc/llvm-project?rev=365567&view=rev Log: [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 Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=365567&r1=365566&r2=365567&view=diff ============================================================================== --- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original) +++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Tue Jul 9 15:24:54 2019 @@ -285,9 +285,6 @@ void IRExecutionUnit::GetRunnableInfo(St 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(St return; } + m_strip_underscore = + (m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_'); + class ObjectDumper : public llvm::ObjectCache { public: void notifyObjectCompiled(const llvm::Module *module, _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits