[PATCH] D62112: [ORC] fix use-after-move

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 18:10:28 PDT 2019


nickdesaulniers updated this revision to Diff 200191.
nickdesaulniers added a comment.

- git-clang-format HEAD~


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62112/new/

https://reviews.llvm.org/D62112

Files:
  llvm/lib/ExecutionEngine/Orc/Layer.cpp


Index: llvm/lib/ExecutionEngine/Orc/Layer.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/Layer.cpp
+++ llvm/lib/ExecutionEngine/Orc/Layer.cpp
@@ -87,17 +87,15 @@
 
 #ifndef NDEBUG
   auto &ES = R.getTargetJITDylib().getExecutionSession();
+  auto &N = R.getTargetJITDylib().getName();
 #endif // NDEBUG
 
   auto Lock = TSM.getContextLock();
-  LLVM_DEBUG(ES.runSessionLocked([&]() {
-    dbgs() << "Emitting, for " << R.getTargetJITDylib().getName() << ", "
-           << *this << "\n";
-  }););
+  LLVM_DEBUG(ES.runSessionLocked(
+      [&]() { dbgs() << "Emitting, for " << N << ", " << *this << "\n"; }););
   L.emit(std::move(R), std::move(TSM));
   LLVM_DEBUG(ES.runSessionLocked([&]() {
-    dbgs() << "Finished emitting, for " << R.getTargetJITDylib().getName()
-           << ", " << *this << "\n";
+    dbgs() << "Finished emitting, for " << N << ", " << *this << "\n";
   }););
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62112.200191.patch
Type: text/x-patch
Size: 953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190520/b9c92f49/attachment.bin>


More information about the llvm-commits mailing list