From 9059158b5613f9d87d2571ea67cef83d5f879106 Mon Sep 17 00:00:00 2001 From: John Criswell Date: Mon, 22 Dec 2003 16:22:49 +0000 Subject: [PATCH] Reverted back to revision 1.11. The previous fix doesn't really fix anything; it just causes the bug to go dormant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10585 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Archive/ArchiveReader.cpp | 15 +++------------ lib/Bytecode/Archive/ArchiveReader.cpp | 15 +++------------ lib/Bytecode/Reader/ArchiveReader.cpp | 15 +++------------ 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 1baaff289e3..b147cb3344e 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -122,17 +122,8 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, while (endp[-1] == ' ') --endp; } - - // - // We now have the beginning and the end of the object name. - // Convert this into a dynamically allocated std::string to pass - // to the routines that create the Module object. We do this - // (I think) because the created Module object will outlive this function, - // but statically declared std::string's won't. - // std::string MemberName (startp, endp); - std::string * FullMemberName; - FullMemberName = new std::string (ArchiveName + "(" + MemberName + ")"); + std::string FullMemberName = ArchiveName + "(" + MemberName + ")"; switch (getObjectType(Hdr, MemberData, MemberSize)) { case SVR4LongFilename: @@ -142,7 +133,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; case UserObject: { Module *M = ParseBytecodeBuffer(MemberData, MemberSize, - *(FullMemberName), ErrorStr); + FullMemberName, ErrorStr); if (!M) return true; Objects.push_back(M); break; @@ -153,7 +144,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; default: std::cerr << "ReadArchiveBuffer: WARNING: Skipping unknown file: " - << *(FullMemberName) << "\n"; + << FullMemberName << "\n"; break; // Just ignore unknown files. } diff --git a/lib/Bytecode/Archive/ArchiveReader.cpp b/lib/Bytecode/Archive/ArchiveReader.cpp index 1baaff289e3..b147cb3344e 100644 --- a/lib/Bytecode/Archive/ArchiveReader.cpp +++ b/lib/Bytecode/Archive/ArchiveReader.cpp @@ -122,17 +122,8 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, while (endp[-1] == ' ') --endp; } - - // - // We now have the beginning and the end of the object name. - // Convert this into a dynamically allocated std::string to pass - // to the routines that create the Module object. We do this - // (I think) because the created Module object will outlive this function, - // but statically declared std::string's won't. - // std::string MemberName (startp, endp); - std::string * FullMemberName; - FullMemberName = new std::string (ArchiveName + "(" + MemberName + ")"); + std::string FullMemberName = ArchiveName + "(" + MemberName + ")"; switch (getObjectType(Hdr, MemberData, MemberSize)) { case SVR4LongFilename: @@ -142,7 +133,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; case UserObject: { Module *M = ParseBytecodeBuffer(MemberData, MemberSize, - *(FullMemberName), ErrorStr); + FullMemberName, ErrorStr); if (!M) return true; Objects.push_back(M); break; @@ -153,7 +144,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; default: std::cerr << "ReadArchiveBuffer: WARNING: Skipping unknown file: " - << *(FullMemberName) << "\n"; + << FullMemberName << "\n"; break; // Just ignore unknown files. } diff --git a/lib/Bytecode/Reader/ArchiveReader.cpp b/lib/Bytecode/Reader/ArchiveReader.cpp index 1baaff289e3..b147cb3344e 100644 --- a/lib/Bytecode/Reader/ArchiveReader.cpp +++ b/lib/Bytecode/Reader/ArchiveReader.cpp @@ -122,17 +122,8 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, while (endp[-1] == ' ') --endp; } - - // - // We now have the beginning and the end of the object name. - // Convert this into a dynamically allocated std::string to pass - // to the routines that create the Module object. We do this - // (I think) because the created Module object will outlive this function, - // but statically declared std::string's won't. - // std::string MemberName (startp, endp); - std::string * FullMemberName; - FullMemberName = new std::string (ArchiveName + "(" + MemberName + ")"); + std::string FullMemberName = ArchiveName + "(" + MemberName + ")"; switch (getObjectType(Hdr, MemberData, MemberSize)) { case SVR4LongFilename: @@ -142,7 +133,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; case UserObject: { Module *M = ParseBytecodeBuffer(MemberData, MemberSize, - *(FullMemberName), ErrorStr); + FullMemberName, ErrorStr); if (!M) return true; Objects.push_back(M); break; @@ -153,7 +144,7 @@ static bool ReadArchiveBuffer(const std::string &ArchiveName, break; default: std::cerr << "ReadArchiveBuffer: WARNING: Skipping unknown file: " - << *(FullMemberName) << "\n"; + << FullMemberName << "\n"; break; // Just ignore unknown files. } -- 2.34.1