[llvm] r258324 - [Orc] Fix a use-after-move bug in the Orc C-bindings stack.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 09:39:53 PST 2016


Author: lhames
Date: Wed Jan 20 11:39:52 2016
New Revision: 258324

URL: http://llvm.org/viewvc/llvm-project?rev=258324&view=rev
Log:
[Orc] Fix a use-after-move bug in the Orc C-bindings stack.

Modified:
    llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h

Modified: llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h?rev=258324&r1=258323&r2=258324&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindingsStack.h Wed Jan 20 11:39:52 2016
@@ -90,12 +90,12 @@ public:
 		    std::unique_ptr<CompileCallbackMgr> CCMgr, 
                     IndirectStubsManagerBuilder IndirectStubsMgrBuilder)
     : DL(TM.createDataLayout()), CCMgr(std::move(CCMgr)),
+      IndirectStubsMgr(IndirectStubsMgrBuilder()),
       ObjectLayer(),
       CompileLayer(ObjectLayer, orc::SimpleCompiler(TM)),
       CODLayer(CompileLayer,
                [](Function &F) { std::set<Function*> S; S.insert(&F); return S; },
                *this->CCMgr, std::move(IndirectStubsMgrBuilder), false),
-      IndirectStubsMgr(IndirectStubsMgrBuilder()),
       CXXRuntimeOverrides([this](const std::string &S) { return mangle(S); }) {}
 
   ~OrcCBindingsStack() {
@@ -264,13 +264,13 @@ private:
   DataLayout DL;
   SectionMemoryManager CCMgrMemMgr;
 
+  std::unique_ptr<orc::IndirectStubsManager> IndirectStubsMgr;
+
   std::unique_ptr<CompileCallbackMgr> CCMgr;
   ObjLayerT ObjectLayer;
   CompileLayerT CompileLayer;
   CODLayerT CODLayer;
 
-  std::unique_ptr<orc::IndirectStubsManager> IndirectStubsMgr;
-
   std::vector<std::unique_ptr<GenericHandle>> GenericHandles;
   std::vector<unsigned> FreeHandleIndexes;
 




More information about the llvm-commits mailing list