[llvm-exegesis] Fix use after free.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D45625

llvm-svn: 330026
This commit is contained in:
Clement Courbet 2018-04-13 14:46:48 +00:00
parent de39a5c881
commit 6c63e70e7b

View File

@ -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<const char *>(