mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-27 13:30:05 +00:00
Fix a pair of use after free. Should bring the bots back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216005 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
548f2b6e8f
commit
f2b844d0b1
@ -72,7 +72,7 @@ MachOUniversalBinary::ObjectForArch::getAsObjectFile() const {
|
||||
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::ObjectForArch::getAsArchive(
|
||||
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())
|
||||
|
Loading…
Reference in New Issue
Block a user