diff --git a/llvm/lib/ProfileData/RawMemProfReader.cpp b/llvm/lib/ProfileData/RawMemProfReader.cpp --- a/llvm/lib/ProfileData/RawMemProfReader.cpp +++ b/llvm/lib/ProfileData/RawMemProfReader.cpp @@ -552,7 +552,7 @@ // callback is the main program." // https://man7.org/linux/man-pages/man3/dl_iterate_phdr.3.html std::vector BuildIds; - llvm::SmallSet BuildIdsSet; + llvm::SmallSet BuildIdsSet; while (Next < DataBuffer->getBufferEnd()) { auto *Header = reinterpret_cast(Next); @@ -564,7 +564,7 @@ if (BuildIdsSet.contains(Id)) continue; BuildIds.push_back(Id); - BuildIdsSet.insert(BuildIds.back()); + BuildIdsSet.insert(Id); } Next += Header->TotalSize;