[llvm] r216071 - Quick fix for an use after free.
Rafael Espindola
rafael.espindola at gmail.com
Wed Aug 20 08:19:37 PDT 2014
Author: rafael
Date: Wed Aug 20 10:19:37 2014
New Revision: 216071
URL: http://llvm.org/viewvc/llvm-project?rev=216071&view=rev
Log:
Quick fix for an use after free.
Modified:
llvm/trunk/tools/lli/lli.cpp
Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=216071&r1=216070&r2=216071&view=diff
==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Wed Aug 20 10:19:37 2014
@@ -529,6 +529,7 @@ int main(int argc, char **argv, char * c
EE->addModule(std::move(XMod));
}
+ std::vector<std::unique_ptr<MemoryBuffer>> Buffers;
for (unsigned i = 0, e = ExtraObjects.size(); i != e; ++i) {
ErrorOr<object::OwningBinary<object::ObjectFile>> Obj =
object::ObjectFile::createObjectFile(ExtraObjects[i]);
@@ -536,7 +537,9 @@ int main(int argc, char **argv, char * c
Err.print(argv[0], errs());
return 1;
}
- EE->addObjectFile(std::move(Obj.get().getBinary()));
+ object::OwningBinary<object::ObjectFile> &O = Obj.get();
+ EE->addObjectFile(std::move(O.getBinary()));
+ Buffers.push_back(std::move(O.getBuffer()));
}
for (unsigned i = 0, e = ExtraArchives.size(); i != e; ++i) {
More information about the llvm-commits
mailing list