[libunwind] Ensure enough alignment for unw_cursor_t for SEH build configurations
authorMartin Storsjö <martin@martin.st>
Mon, 17 Aug 2020 19:41:58 +0000 (22:41 +0300)
committerMartin Storsjö <martin@martin.st>
Sat, 22 Aug 2020 19:48:57 +0000 (22:48 +0300)
commit542db87f1ac67087aeb5cf572b1f9744d482da69
treecdf123b25dcf9fe831d52e1bb9d3ad063b4ecced
parentc1dc44f914e250979cf95dd486a3b87d2d692bd4
[libunwind] Ensure enough alignment for unw_cursor_t for SEH build configurations

When built in SEH mode, UnwindCursor contains a CONTEXT struct,
which is aligned to 16 bytes in most configurations, causing the
whole UnwindCursor object to have 16 byte alignment.

This fixes backtraces using _Unwind_Backtrace on x86_64 mingw,
where an unw_cursor_t allocated on the stack was misaligned before.

This is an ABI break for this struct for this configuration, but very
few callers call libunwind directly (and even fewer directly allocate
an unw_cursor_t anyway).

Differential Revision: https://reviews.llvm.org/D86102
libunwind/include/libunwind.h
libunwind/src/UnwindCursor.hpp