[LLVMdev] bug in ilist_node::getPrevNode() ?

Reid Kleckner rnk at google.com
Thu Jul 10 14:55:31 PDT 2014


I tripped over that also, it seems like a bug to me.


On Thu, Jul 10, 2014 at 5:59 AM, Erik Eckstein <eeckstein at apple.com> wrote:

> Hi all,
>
> I stumbled over a problem in ilist_node::getPrevNode(). It crashes when
> invoked for the first element in a list.
> It's because the Prev pointer of a first list element does not point to
> the sentinel  but is just null.
>
> First question: Is this really a bug or am I doing something wrong?
> Second question: If it is a bug, what should be the correct behaviour?
> Either change insert() to let Prev of the first element really point to the
> sentinel or just change getPrevNode()?
>
> I don't really need getPrevNode() because I can also use iterators but if
> this is really a bug, I think it should be fixed.
>
> Thanks,
> Erik
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140710/305d9b50/attachment.html>


More information about the llvm-dev mailing list