This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]