]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libcxxrt: add padding in __cxa_allocate_* to fix alignment
authorEd Maste <emaste@FreeBSD.org>
Thu, 21 Jul 2016 18:20:35 +0000 (18:20 +0000)
committerEd Maste <emaste@FreeBSD.org>
Thu, 21 Jul 2016 18:20:35 +0000 (18:20 +0000)
commit3c4fd2463bb29f65ef1404011fcb31e508cdf2e2
tree1c5faa7b67e52a2c3ed81e721e29949fcb5aa7bb
parentbb04182c902075e81578400e81e2cb1c05f6bbcd
libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7271
contrib/libcxxrt/exception.cc