diff options
author | Alexander Yermolovich <ayermolo@meta.com> | 2023-04-17 17:48:54 -0700 |
---|---|---|
committer | Alexander Yermolovich <ayermolo@meta.com> | 2023-04-17 17:56:08 -0700 |
commit | 125df67421cfaef9980f98b4e41613964df81129 (patch) | |
tree | b4de3840f7fa1ae0cf8568279826f58a853d5e81 /bolt/lib | |
parent | 3f3fe7c9a3e7aefe349a7670d76aae9ebc4c9792 (diff) | |
download | llvm-125df67421cfaef9980f98b4e41613964df81129.tar.gz |
[BOLT][DWARF] Fix handling of CUs without TU reference
When input is DWP with DWARF5 bolt wasn't handling correctly CUs that didn't
have TU references. Which resulted in a crash.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D148589
Diffstat (limited to 'bolt/lib')
-rw-r--r-- | bolt/lib/Rewrite/DWARFRewriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp index 5b8a28465fd7..cffcde821379 100644 --- a/bolt/lib/Rewrite/DWARFRewriter.cpp +++ b/bolt/lib/Rewrite/DWARFRewriter.cpp @@ -1347,6 +1347,8 @@ static void extractTypesFromDWPDWARF5( MCStreamer &Streamer, StringRef Contents, uint64_t DWOId) { std::vector<const DWARFUnitIndex::Entry::SectionContribution *> TUContributions; + if (!TypeSignaturesPerCU.count(DWOId)) + return; for (const uint64_t Val : TypeSignaturesPerCU.at(DWOId)) { const DWARFUnitIndex::Entry *TUE = TUIndex.getFromHash(Val); const DWARFUnitIndex::Entry::SectionContribution *C = |