[llvm-commits] [lld] r171576 - /lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Fri Jan 4 16:46:24 PST 2013
Author: mspencer
Date: Fri Jan 4 18:46:23 2013
New Revision: 171576
URL: http://llvm.org/viewvc/llvm-project?rev=171576&view=rev
Log:
[ELF][Writer] Don't infinite loop.
This will be tested by a following committ that runs the linker
with no inputs.
Modified:
lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp
Modified: lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp?rev=171576&r1=171575&r2=171576&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/WriterELF.cpp Fri Jan 4 18:46:23 2013
@@ -1755,7 +1755,7 @@
_programHeader->setFileOffset(_elfHeader->fileSize());
}
bool newSegmentHeaderAdded = true;
- while (true) {
+ while (true && !_segments.empty()) {
for (auto si : _segments) {
newSegmentHeaderAdded = _programHeader->addSegment(si);
numSlices += si->numSlices();
More information about the llvm-commits
mailing list