<div dir="ltr">I think the implicit iterator conversions are much less important now that we have range based for loops, but I still like having them.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 20, 2015 at 11:13 AM, Duncan P. N. Exon Smith via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-Oct-07, at 17:57, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br>
><br>
> I've been digging into some undefined behaviour stemming from how ilist<br>
> is typically configured.  r247937, r247944, and r247978 caused a UBSan<br>
> failure to start firing on our Green Dragon bots, and after an IRC<br>
> conversation between David and Nick and Mehdi, we added a blacklist:<br>
> --<br>
> $echo "src:$WORKSPACE/llvm/include/llvm/CodeGen/MachineFunction.h" >> sanitize.blacklist<br>
> --<br>
><br>
> ilist/iplist is a pretty strange list, and the more I dig into it (to<br>
> fix the UB) the more broken I think it is.<br>
><br>
> I want to change a few things about it, but it'll be somewhat<br>
> intrusive (pun not really intended), so I want to get some buy-in before<br>
> really diving in.  I've CC'ed the people in the IRC conversation and a<br>
> couple of others that seem to care about ADT and/or UB.<br>
<br>
</span>A quick update on this.<br>
<br>
The first problem I hit was that there are callers that *rely* on<br>
`getNextNode()` returning the sentinel instead of `nullptr`.  If you<br>
look at the implementation of `getNextNode()`, that's kind of insane.<br>
<br>
The only way I could think to root out all the similar issues was to<br>
look at every call to the implicit conversions and confirm they aren't<br>
doing anything strange.  Most easily done by applying the attached<br>
patch, and getting this compiling again.  I have some more commentary<br>
in, e.g., r249767 and r249782.<br>
<br>
Some of the problems I've uncovered include r249758, r249763, r249764,<br>
and more scary cases like r249925 and r250211.<br>
<br>
I've almost finished LLVM proper, but I haven't touched clang yet, or<br>
other LLVM projects.<br>
<br>
Is there any contention about this?  Do we eventually want to commit<br>
this patch, or should we go back to our old implicit ways once I've<br>
cleaned up ilist and iplist?  (Basically, should we make clang clean<br>
too and commit this patch, or should I just fix the bugs?)<br>
<br>
<br><br>
<br>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>