From 4abbd13ab2ae459cc1e57eb8a6b31cc8ea796064 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 16 Jul 2018 15:01:26 +0000 Subject: [PATCH] Fix warnings in a static assert added to CFI. llvm-svn: 337178 --- compiler-rt/lib/cfi/cfi.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/cfi/cfi.cc b/compiler-rt/lib/cfi/cfi.cc index 5ee8365..a2f127f 100644 --- a/compiler-rt/lib/cfi/cfi.cc +++ b/compiler-rt/lib/cfi/cfi.cc @@ -134,7 +134,8 @@ void ShadowBuilder::AddUnchecked(uptr begin, uptr end) { uint16_t *shadow_end = MemToShadow(end - 1, shadow_) + 1; // memset takes a byte, so our unchecked shadow value requires both bytes to // be the same. Make sure we're ok during compilation. - static_assert(kUncheckedShadow & 0xff == ((kUncheckedShadow >> 8) & 0xff)); + static_assert((kUncheckedShadow & 0xff) == ((kUncheckedShadow >> 8) & 0xff), + "Both bytes of the 16-bit value must be the same!"); memset(shadow_begin, kUncheckedShadow & 0xff, (shadow_end - shadow_begin) * sizeof(*shadow_begin)); } -- 2.7.4