[PATCH] D23466: ADT: Remove UB in ilist (and use a circular linked list)

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 14:53:25 PDT 2016


dexonsmith updated the summary for this revision.
dexonsmith updated this revision to Diff 68256.
dexonsmith added a comment.

Hans ran the tests yesterday on Windows, and an end() dereference manifested as an infinite loop.  He has convinced me we really need some assertions to root out long-standing bugs that the optimizers may suddenly be exploiting.  Hans suggested asserting in operator*() and that makes sense to me.

- I'm updating the summary here on Phab to match my working commit message (options #1, #2 and #3 have changed).
- The updated patch asserts that the sentinel is never dereferenced (it uses a PointerIntPair to pack IsSentinel into Prev).
- I'm working on fixing the (many, many) crashes that this gives when running 'check'.
- I'll post back here when 'check' and 'check-clang' are clean.  At that point I'll try a bootstrap of 'clang' on Darwin/x86_64, since this is exposing a lot of bugs and I don't entirely trust our lit-test coverage.  Volunteers for other configurations welcome!  (Otherwise I'll leave it to the bots.)


https://reviews.llvm.org/D23466

Files:
  include/llvm/ADT/ilist.h
  include/llvm/ADT/ilist_node.h
  unittests/ADT/ilistTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23466.68256.patch
Type: text/x-patch
Size: 28320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160816/a30f020e/attachment.bin>


More information about the llvm-commits mailing list