[LLVMdev] Questions about llvm/Object/COFF.h
Marshall Clow
mclow.lists at gmail.com
Tue Jun 12 19:37:28 PDT 2012
On Jun 12, 2012, at 7:05 PM, Sean Silva wrote:
> > BTW - patch attached to add pre-increment to llvm::content_iterator (which is the template base for section_iterator, etc)
> >
> > -- Marshall
>
>
> Index: include/llvm/Object/ObjectFile.h
> ===================================================================
> --- include/llvm/Object/ObjectFile.h (revision 158307)
> +++ include/llvm/Object/ObjectFile.h (working copy)
> + content_iterator& operator++() {
> + error_code ec;
> + return this->increment (ec);
> + }
>
> This is wrong. It ignores the error. operator ++ should be implemented
> the same way as ++ is in include/llvm/Support/YAMLParser.h. If
> iteration fails, turn the iterator into an end iterator and set a
> failed flag and allow the user to access the error_code.
As I said to Michael in private email - this is at least as wrong, since it throws away the position in the sequence where the error occurs.
-- Marshall
Marshall Clow Idio Software <mailto:mclow.lists at gmail.com>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
-- Yu Suzuki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120612/1158e743/attachment.html>
More information about the llvm-dev
mailing list