davidxl added a subscriber: davidxl.
davidxl added a comment.

In libc++, placement new is used in many places.  When selecting the buffer 
size for the placed object, it uses the 'actual' size of the buffer including 
the padding bytes from alignment, instead of the declared of the buffer. As a 
result, the declared buffer size may be smaller than the target object.   Due 
to this mismatch, the compiler may see out of bound access of the buffer thus 
miscompile the program.

The purpose of the fix is to make the declared size == actual buffer size.


http://reviews.llvm.org/D12247



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to