projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
055bdb9
)
Use iterators to avoid dereferencing end().
author
Rafael Espindola
<rafael.espindola@gmail.com>
Wed, 20 Jul 2016 17:41:18 +0000
(17:41 +0000)
committer
Rafael Espindola
<rafael.espindola@gmail.com>
Wed, 20 Jul 2016 17:41:18 +0000
(17:41 +0000)
Thanks to George Rimar for finding the problem.
llvm-svn: 276144
lld/ELF/Relocations.cpp
patch
|
blob
|
history
diff --git
a/lld/ELF/Relocations.cpp
b/lld/ELF/Relocations.cpp
index
1ed8653
..
e5e409d
100644
(file)
--- a/
lld/ELF/Relocations.cpp
+++ b/
lld/ELF/Relocations.cpp
@@
-525,11
+525,11
@@
static void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
ArrayRef<uint8_t> SectionData = C.getSectionData();
const uint8_t *Buf = SectionData.begin();
-
SectionPiece *PieceI = nullptr
;
-
SectionPiece *PieceE = nullptr
;
+
std::vector<SectionPiece>::iterator PieceI
;
+
std::vector<SectionPiece>::iterator PieceE
;
if (auto *Eh = dyn_cast<EhInputSection<ELFT>>(&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) {