diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h --- a/llvm/include/llvm/ProfileData/SampleProf.h +++ b/llvm/include/llvm/ProfileData/SampleProf.h @@ -149,8 +149,9 @@ return "CSNameTableSection"; case SecLBRProfile: return "LBRProfileSection"; + default: + return "UnknownSection"; } - llvm_unreachable("A SecType has no name for output"); } // Entry type of section header table used by SampleProfileExtBinaryBaseReader diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h --- a/llvm/include/llvm/ProfileData/SampleProfReader.h +++ b/llvm/include/llvm/ProfileData/SampleProfReader.h @@ -786,6 +786,8 @@ virtual std::error_code verifySPMagic(uint64_t Magic) override; virtual std::error_code readCustomSection(const SecHdrTableEntry &Entry) override { + // Update the data reader pointer to the end of the section. + Data += Entry.Size; return sampleprof_error::success; }; diff --git a/llvm/test/tools/llvm-profdata/Inputs/unknown.section.extbin.profdata b/llvm/test/tools/llvm-profdata/Inputs/unknown.section.extbin.profdata new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@