summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2015-03-16 09:53:42 +0000
committerGabor Horvath <xazax.hun@gmail.com>2015-03-16 09:53:42 +0000
commitfee043439c8f2dc63c408228ea52fdefb6514d80 (patch)
tree69ff502bbfae13e758a78b6cbee43a183459e070 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
parentbd250daee053252042ed5a33c8b13e3b24a61f52 (diff)
downloadbcm5719-llvm-fee043439c8f2dc63c408228ea52fdefb6514d80.tar.gz
bcm5719-llvm-fee043439c8f2dc63c408228ea52fdefb6514d80.zip
[llvm] Replacing asserts with static_asserts where appropriate
Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, llvm-commits Differential Revision: http://reviews.llvm.org/D8343 llvm-svn: 232366
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index c9130925f51..f46a1276f89 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -1621,7 +1621,11 @@ static int StackMallocSizeClass(uint64_t LocalStackSize) {
void FunctionStackPoisoner::SetShadowToStackAfterReturnInlined(
IRBuilder<> &IRB, Value *ShadowBase, int Size) {
assert(!(Size % 8));
- assert(kAsanStackAfterReturnMagic == 0xf5);
+
+ #ifndef NDEBUG
+ static_assert(kAsanStackAfterReturnMagic == 0xf5, "");
+ #endif
+
for (int i = 0; i < Size; i += 8) {
Value *p = IRB.CreateAdd(ShadowBase, ConstantInt::get(IntptrTy, i));
IRB.CreateStore(ConstantInt::get(IRB.getInt64Ty(), 0xf5f5f5f5f5f5f5f5ULL),
OpenPOWER on IntegriCloud