[Lldb-commits] [PATCH] D64434: [lldb] Quick Fix: IRExecutionUnit check pointer before access it

Wanyi Ye via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 9 11:48:44 PDT 2019


kusmour created this revision.
kusmour added reviewers: xiaobai, compnerd.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64434

Files:
  lldb/source/Expression/IRExecutionUnit.cpp


Index: lldb/source/Expression/IRExecutionUnit.cpp
===================================================================
--- lldb/source/Expression/IRExecutionUnit.cpp
+++ lldb/source/Expression/IRExecutionUnit.cpp
@@ -285,9 +285,6 @@

   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 @@
     return;
   }

+  m_strip_underscore =
+      (m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');
+
   class ObjectDumper : public llvm::ObjectCache {
   public:
     void notifyObjectCompiled(const llvm::Module *module,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64434.208763.patch
Type: text/x-patch
Size: 797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190709/be3269d2/attachment.bin>


More information about the lldb-commits mailing list