This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: aranges
- From: Roland McGrath <roland at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 04 Feb 2009 15:55:03 -0800
- Subject: Re: aranges
> Hm, I'm reviewing the fix, and am having second thoughts. I see this in
> ranges::const_iterator::operator *:
>
> if (unlikely (_m_offset == 1))
> throw std::runtime_error ("dereferencing end iterator");
>
> Seeing that the end iterator has _m_offset == 0, the right place to fix
> that bug is probably operator*.
Yes, that check should be fixed. But note those checks are only to throw a
graceful exception for a case that morally is "undefined"--if the iterator
were a pointer, you would have been accessing a bogus address and might crash.
So if this (when fixed) hits it just means a higher level bug anyway.
Thanks,
Roland