[PATCH] D61667: Assume `__cxa_allocate_exception` returns an under-aligned memory on Darwin if the version of libc++abi isn't new enough to include the fix in r319123

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 8 02:22:50 PDT 2019


ahatanak created this revision.
ahatanak added reviewers: rjmccall, ldionne.
ahatanak added a project: clang.
Herald added a reviewer: EricWF.
Herald added subscribers: dexonsmith, jkorous.

This patch resurrects r264998, which was committed to work around a bug in libc++abi that was causing `_cxa_allocate_exception` to return a memory that wasn't double-word aligned.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160328/154332.html

I reverted r264998 after fixing the bug in libc++abi in r319123 (see the link below), but didn't really realize that doing so could break projects using older versions of libc++abi that don't have the fix committed in r319123.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20171127/210878.html

In addition, this patch makes clang issue a warning if the type of the thrown object requires an alignment that is larger than the minimum alignment the libc++abi runtime guarantees.


Repository:
  rC Clang

https://reviews.llvm.org/D61667

Files:
  include/clang/Basic/AlignedExceptionObject.h
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/TargetInfo.h
  lib/Basic/Targets/OSTargets.h
  lib/CodeGen/ItaniumCXXABI.cpp
  lib/Sema/SemaExprCXX.cpp
  test/CodeGenCXX/eh.cpp
  test/SemaCXX/warn-overaligned-type-thrown.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61667.198601.patch
Type: text/x-patch
Size: 11973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190508/541b63fc/attachment-0001.bin>


More information about the cfe-commits mailing list