[llvm-dev] ilist/iplist are broken (maybe I'll fix them?)

Duncan P. N. Exon Smith via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 10 18:34:53 PST 2015


> On 2015-Oct-07, at 17:57, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
> What's broken?
> --------------
> 
> Unless I'm misreading the code horribly,
> BasicBlock/Instruction/Argument::getPrevNode/getNextNode() will *never*
> return `nullptr`.  Instead they'll just return the sentinel.  Which has
> been `static_cast`ed to a completely different type.  And if someone
> dereferences it, *bang*.  There are other cases, too, but these are the
> obviously scary ones.
> 

This part -- the actively broken code -- should be fixed as of r252694.
Once that bakes for a day or so, I'll follow up and fix the rest of the
UB (I think the hard part is done).


More information about the llvm-dev mailing list