[compiler-rt] r337178 - Fix warnings in a static assert added to CFI.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 08:01:26 PDT 2018


Author: chandlerc
Date: Mon Jul 16 08:01:26 2018
New Revision: 337178

URL: http://llvm.org/viewvc/llvm-project?rev=337178&view=rev
Log:
Fix warnings in a static assert added to CFI.

Modified:
    compiler-rt/trunk/lib/cfi/cfi.cc

Modified: compiler-rt/trunk/lib/cfi/cfi.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/cfi/cfi.cc?rev=337178&r1=337177&r2=337178&view=diff
==============================================================================
--- compiler-rt/trunk/lib/cfi/cfi.cc (original)
+++ compiler-rt/trunk/lib/cfi/cfi.cc Mon Jul 16 08:01:26 2018
@@ -134,7 +134,8 @@ void ShadowBuilder::AddUnchecked(uptr be
   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));
 }




More information about the llvm-commits mailing list