Skip to content

Commit 8f3f8e6

Browse files
committed
[nsan] Use ALIGNED instead of alignas (NFC)
When preceded by SANITIZER_INTERFACE_ATTRIBUTE, use the ALIGNED macro instead of alignas, because clang 15 and older does not support this. See https://clang.godbolt.org/z/Wj1193xWK.
1 parent 93d7d9b commit 8f3f8e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler-rt/lib/nsan/nsan.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,23 +391,23 @@ __nsan_dump_shadow_mem(const u8 *addr, size_t size_bytes, size_t bytes_per_line,
391391
}
392392

393393
SANITIZER_INTERFACE_ATTRIBUTE
394-
alignas(16) thread_local uptr __nsan_shadow_ret_tag = 0;
394+
ALIGNED(16) thread_local uptr __nsan_shadow_ret_tag = 0;
395395

396396
SANITIZER_INTERFACE_ATTRIBUTE
397-
alignas(16) thread_local char __nsan_shadow_ret_ptr[kMaxVectorWidth *
398-
sizeof(__float128)];
397+
ALIGNED(16)
398+
thread_local char __nsan_shadow_ret_ptr[kMaxVectorWidth * sizeof(__float128)];
399399

400400
SANITIZER_INTERFACE_ATTRIBUTE
401-
alignas(16) thread_local uptr __nsan_shadow_args_tag = 0;
401+
ALIGNED(16) thread_local uptr __nsan_shadow_args_tag = 0;
402402

403403
// Maximum number of args. This should be enough for anyone (tm). An alternate
404404
// scheme is to have the generated code create an alloca and make
405405
// __nsan_shadow_args_ptr point ot the alloca.
406406
constexpr const int kMaxNumArgs = 128;
407407
SANITIZER_INTERFACE_ATTRIBUTE
408-
alignas(
409-
16) thread_local char __nsan_shadow_args_ptr[kMaxVectorWidth * kMaxNumArgs *
410-
sizeof(__float128)];
408+
ALIGNED(16)
409+
thread_local char
410+
__nsan_shadow_args_ptr[kMaxVectorWidth * kMaxNumArgs * sizeof(__float128)];
411411

412412
enum ContinuationType { // Keep in sync with instrumentation pass.
413413
kContinueWithShadow = 0,

0 commit comments

Comments
 (0)