diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2018-07-05 06:24:29 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2018-07-05 06:24:29 +0000 |
commit | a155dc1743c7f7cdb06b4caf507a949df8827ec0 (patch) | |
tree | 8a293c8535850b027832c1bcf8f61d5a9a58ed6e /libcxxabi | |
parent | 258aad10081ba121f8b0be4a02a4a2a0bd3e492a (diff) |
[demangler] Avoid alignment warning
The alignment specified by a constant for the field
`BumpPointerAllocator::InitialBuffer` exceeded the alignment
guaranteed by `malloc` and `new` on Windows. This change set
the alignment value to that of `long double`, which is defined
by the used platform.
It fixes https://bugs.llvm.org/show_bug.cgi?id=37944.
Differential Revision: https://reviews.llvm.org/D48889
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/src/cxa_demangle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp index d70ffdf1065..901db66b270 100644 --- a/libcxxabi/src/cxa_demangle.cpp +++ b/libcxxabi/src/cxa_demangle.cpp @@ -1890,7 +1890,7 @@ class BumpPointerAllocator { static constexpr size_t AllocSize = 4096; static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta); - alignas(16) char InitialBuffer[AllocSize]; + alignas(long double) char InitialBuffer[AllocSize]; BlockMeta* BlockList = nullptr; void grow() { |