File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -406,9 +406,9 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
406
406
DataExtractor D (IndexStr, DCtx.isLittleEndian (), 0 );
407
407
if (!Index.parse (D))
408
408
return 1 ;
409
- IntervalMap<uint32_t , uint64_t >::Allocator Alloc ;
410
- std::vector<IntervalMap< uint32_t , uint64_t >> Sections (
411
- Index.getColumnKinds ().size (), IntervalMap< uint32_t , uint64_t >(Alloc ));
409
+ using MapType = IntervalMap<uint32_t , uint64_t >;
410
+ MapType::Allocator Alloc;
411
+ std::vector<std::unique_ptr<MapType>> Sections ( Index.getColumnKinds ().size ());
412
412
for (const DWARFUnitIndex::Entry &E : Index.getRows ()) {
413
413
uint64_t Sig = E.getSignature ();
414
414
if (!E.getContributions ())
@@ -421,7 +421,9 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
421
421
int Col = E.index ();
422
422
if (SC.Length == 0 )
423
423
continue ;
424
- auto &M = Sections[Col];
424
+ if (!Sections[Col])
425
+ Sections[Col] = std::make_unique<MapType>(Alloc);
426
+ auto &M = *Sections[Col];
425
427
auto I = M.find (SC.Offset );
426
428
if (I != M.end () && I.start () < (SC.Offset + SC.Length )) {
427
429
error () << llvm::formatv (
You can’t perform that action at this time.
0 commit comments