<div dir="ltr">Probably works because a linked list doesn't necessarily need to consult the list object itself when doing operations on subranges of it - it can manipulate the nodes directly so it doesn't tend to matter what list those nodes belong to.<br><br>& if it doesn't fail, inevitably someone'll accidentally rely on it.<br><br>An assert wouldn't be a bad thing, I think.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 16, 2019 at 1:53 AM Jonas Paulsson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
It has been discovered that SystemZTargetLowering::emitSelect() calls <br>
erase() on a range of instructions on the wrong MBB, without any assert <br>
triggering with seemingly correct behaviour (!). StartMBB->erase() <br>
should be JoinMBB->erase() since that's where the SelectPseudo(s) will <br>
reside.<br>
<br>
I am not sure why this "works" at the moment, or why there is not an <br>
assert checking for this. I made a patch to add asserts in erase() and <br>
remove() methods (attached), but found no other cases, though.<br>
<br>
Is there a reason this is not asserted in ilist?<br>
<br>
/Jonas<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>