[llvm] r216005 - Fix a pair of use after free. Should bring the bots back.
Rafael Espindola
rafael.espindola at gmail.com
Tue Aug 19 11:59:14 PDT 2014
Author: rafael
Date: Tue Aug 19 13:59:14 2014
New Revision: 216005
URL: http://llvm.org/viewvc/llvm-project?rev=216005&view=rev
Log:
Fix a pair of use after free. Should bring the bots back.
Modified:
llvm/trunk/lib/Object/MachOUniversal.cpp
Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=216005&r1=216004&r2=216005&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Tue Aug 19 13:59:14 2014
@@ -72,7 +72,7 @@ MachOUniversalBinary::ObjectForArch::get
if (Parent) {
StringRef ParentData = Parent->getData();
StringRef ObjectData = ParentData.substr(Header.offset, Header.size);
- StringRef ObjectName = Parent->getFileName().str();
+ StringRef ObjectName = Parent->getFileName();
MemoryBufferRef ObjBuffer(ObjectData, ObjectName);
return ObjectFile::createMachOObjectFile(ObjBuffer);
}
@@ -84,7 +84,7 @@ std::error_code MachOUniversalBinary::Ob
if (Parent) {
StringRef ParentData = Parent->getData();
StringRef ObjectData = ParentData.substr(Header.offset, Header.size);
- std::string ObjectName = Parent->getFileName().str();
+ StringRef ObjectName = Parent->getFileName();
MemoryBufferRef ObjBuffer(ObjectData, ObjectName);
ErrorOr<std::unique_ptr<Archive>> Obj = Archive::create(ObjBuffer);
if (std::error_code EC = Obj.getError())
More information about the llvm-commits
mailing list