diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 1ed8653a0afe..e5e409dd6c0d 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -525,11 +525,11 @@ static void scanRelocs(InputSectionBase &C, ArrayRef Rels) { ArrayRef SectionData = C.getSectionData(); const uint8_t *Buf = SectionData.begin(); - SectionPiece *PieceI = nullptr; - SectionPiece *PieceE = nullptr; + std::vector::iterator PieceI; + std::vector::iterator PieceE; if (auto *Eh = dyn_cast>(&C)) { - PieceI = &*Eh->Pieces.begin(); - PieceE = &*Eh->Pieces.end(); + PieceI = Eh->Pieces.begin(); + PieceE = Eh->Pieces.end(); } for (auto I = Rels.begin(), E = Rels.end(); I != E; ++I) {