[PATCH] [libcxx] Attempt to fix undefined behavior in list, forward_list and __tree.

Eric Fiselier eric at efcs.ca
Wed Jan 14 11:59:15 PST 2015


Hi mclow.lists, rsmith, sam.saariste,

I'm not 100% confident in this patch yet but because of the time crunch with the 3.6 release I'm posting it early.

The patch works by using `static_cast` on fancy class-like pointers and `reinterpret_cast` on raw pointers. It also changes it so that when the base node class is needed at a call site then it gets the base pointer directly instead of the derived pointer.

I'll do more work on this and actually convince myself of its correctness.

http://reviews.llvm.org/D6974

Files:
  include/__tree
  include/forward_list
  include/list
  include/memory

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6974.18172.patch
Type: text/x-patch
Size: 20010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150114/57943109/attachment.bin>


More information about the cfe-commits mailing list