summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2018-07-16 15:01:26 +0000
committerChandler Carruth <chandlerc@gmail.com>2018-07-16 15:01:26 +0000
commit42fe45beebf064be922d85a21eb869c0b949ab32 (patch)
tree6a6555a2e1136a797024e4301f728e8c1d35d74b
parent470c007a35d1ead76e2e52c262227228042178df (diff)
Fix warnings in a static assert added to CFI.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337178 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/cfi/cfi.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cfi/cfi.cc b/lib/cfi/cfi.cc
index 5ee836569..a2f127f93 100644
--- a/lib/cfi/cfi.cc
+++ b/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));
}