From 5031ac2c1dc19dd1469b076eb7fd9162b5d09d08 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Fri, 13 Apr 2018 14:46:48 +0000 Subject: [PATCH] [llvm-exegesis] Fix use after free. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D45625 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330026 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-exegesis/lib/InMemoryAssembler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/llvm-exegesis/lib/InMemoryAssembler.cpp b/tools/llvm-exegesis/lib/InMemoryAssembler.cpp index 7e1e58ff888..00b7ee74ca0 100644 --- a/tools/llvm-exegesis/lib/InMemoryAssembler.cpp +++ b/tools/llvm-exegesis/lib/InMemoryAssembler.cpp @@ -215,7 +215,7 @@ JitFunction::JitFunction(JitFunctionContext &&Context, // Adding the generated object file containing the assembled function. // The ExecutionEngine makes sure the object file is copied into an // executable page. - ExecEngine->addObjectFile(ObjHolder.takeBinary().first); + ExecEngine->addObjectFile(std::move(ObjHolder)); // Setting function FunctionBytes = llvm::StringRef(reinterpret_cast( -- 2.11.0