mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Fix a use after free.
llvm-svn: 312590
This commit is contained in:
parent
60e97a1d60
commit
8948c6baa1
@ -80,11 +80,11 @@ ELFDumper<ELFT>::getUniquedSectionName(const Elf_Shdr *Sec) {
|
||||
if (!NameOrErr)
|
||||
return NameOrErr;
|
||||
StringRef Name = *NameOrErr;
|
||||
std::string Ret = Name;
|
||||
std::string &Ret = SectionNames[SecIndex];
|
||||
Ret = Name;
|
||||
while (!UsedSectionNames.insert(Ret).second)
|
||||
Ret = (Name + to_string(++Suffix)).str();
|
||||
SectionNames[SecIndex] = Ret;
|
||||
return SectionNames[SecIndex];
|
||||
return Ret;
|
||||
}
|
||||
|
||||
template <class ELFT> ErrorOr<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
|
||||
|
Loading…
Reference in New Issue
Block a user