]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: stop iterator on error
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Jan 2019 22:58:04 +0000 (22:58 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Jan 2019 22:58:04 +0000 (22:58 +0000)
commit4123e263f10b16111bce494e16d87bf05e78b174
tree805b10a222dd770260a63a4af45cdde56018196b
parent77fe9474a57d5947867ae55b14881133e0636c74
compiler: stop iterator on error

    If there is an error reading or parsing an archive header, the
    Archive_iterator code would return a dummy header but would not mark
    itself as done.  The effect is that an invalid archive leads to an
    endless loop reading and re-reading the same archive header.  Avoid
    that by setting the offset to the end of the file, which will cause
    the iterator to == archive_end.

    No test since it doesn't seem worth constructing an invalid archive.

    Reviewed-on: https://go-review.googlesource.com/c/158217

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268129 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/import-archive.cc