Skip to content

Commit

Permalink
Bug 1661810 - Define pre_align/post_align based on the compiler. r=jcj
Browse files Browse the repository at this point in the history
Things worked fine before we upgraded to clang 11 presumably because the
stack was always 16-bytes aligned in the first place, or something akin
to that, and the lack of pre_align/post_align doing anything didn't
matter. The runtime misalignment of the stack may well be a clang > 9
bug, but keeping pre_align/post_align tied to the x86/x64 is a footgun
anyways.

Differential Revision: https://phabricator.services.mozilla.com/D88667

--HG--
extra : moz-landing-system : lando
  • Loading branch information
glandium committed Aug 28, 2020
1 parent 7dccc54 commit 12c08ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/freebl/blapii.h
Expand Up @@ -60,10 +60,10 @@ SEC_END_PROTOS
#endif

/* Alignment helpers. */
#if defined(_WINDOWS) && defined(NSS_X86_OR_X64)
#if defined(_MSC_VER)
#define pre_align __declspec(align(16))
#define post_align
#elif defined(NSS_X86_OR_X64)
#elif defined(__GNUC__)
#define pre_align
#define post_align __attribute__((aligned(16)))
#else
Expand Down

0 comments on commit 12c08ef

Please sign in to comment.