[compiler-rt] r224600 - [ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().
Alexey Samsonov
vonosmas at gmail.com
Fri Dec 19 11:16:03 PST 2014
Author: samsonov
Date: Fri Dec 19 13:16:02 2014
New Revision: 224600
URL: http://llvm.org/viewvc/llvm-project?rev=224600&view=rev
Log:
[ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().
Modified:
compiler-rt/trunk/lib/asan/asan_flags.cc
Modified: compiler-rt/trunk/lib/asan/asan_flags.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.cc?rev=224600&r1=224599&r2=224600&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_flags.cc Fri Dec 19 13:16:02 2014
@@ -50,11 +50,6 @@ void ParseFlagsFromString(Flags *f, cons
"Requirement: redzone >= 16, is a power of two.");
ParseFlag(str, &f->max_redzone, "max_redzone",
"Maximal size (in bytes) of redzones around heap objects.");
- CHECK_GE(f->redzone, 16);
- CHECK_GE(f->max_redzone, f->redzone);
- CHECK_LE(f->max_redzone, 2048);
- CHECK(IsPowerOfTwo(f->redzone));
- CHECK(IsPowerOfTwo(f->max_redzone));
ParseFlag(str, &f->debug, "debug",
"If set, prints some debugging information and does additional checks.");
@@ -285,6 +280,11 @@ void InitializeFlags(Flags *f) {
}
CHECK_LE((uptr)cf->malloc_context_size, kStackTraceMax);
CHECK_LE(f->min_uar_stack_size_log, f->max_uar_stack_size_log);
+ CHECK_GE(f->redzone, 16);
+ CHECK_GE(f->max_redzone, f->redzone);
+ CHECK_LE(f->max_redzone, 2048);
+ CHECK(IsPowerOfTwo(f->redzone));
+ CHECK(IsPowerOfTwo(f->max_redzone));
}
} // namespace __asan
More information about the llvm-commits
mailing list