[sanitizer] Move CheckVMASize after flag initialization

llvm-svn: 247684
This commit is contained in:
Adhemerval Zanella 2015-09-15 13:22:54 +00:00
parent 18d4b0dab7
commit 172cc32ef3
4 changed files with 8 additions and 7 deletions

View File

@ -377,6 +377,8 @@ static void AsanInitInternal() {
// initialization steps look at flags().
InitializeFlags();
CheckVMASize();
AsanCheckIncompatibleRT();
AsanCheckDynamicRTPrereqs();
@ -585,7 +587,6 @@ void NOINLINE __asan_set_death_callback(void (*callback)(void)) {
// Initialize as requested from instrumented application code.
// We use this call as a trigger to wake up ASan from deactivated state.
void __asan_init() {
CheckVMASize();
AsanActivate();
AsanInitInternal();
}

View File

@ -399,6 +399,8 @@ static void dfsan_fini() {
}
static void dfsan_init(int argc, char **argv, char **envp) {
InitializeFlags();
CheckVMASize();
MmapFixedNoReserve(kShadowAddr, kUnusedAddr - kShadowAddr);
@ -412,7 +414,6 @@ static void dfsan_init(int argc, char **argv, char **envp) {
if (!(init_addr >= kUnusedAddr && init_addr < kAppAddr))
MmapNoAccess(kUnusedAddr, kAppAddr - kUnusedAddr);
InitializeFlags();
InitializeInterceptors();
// Register the fini callback to run when the program terminates successfully

View File

@ -375,12 +375,13 @@ void __msan_init() {
msan_init_is_running = 1;
SanitizerToolName = "MemorySanitizer";
CheckVMASize();
InitTlsSize();
CacheBinaryName();
InitializeFlags();
CheckVMASize();
__sanitizer_set_report_path(common_flags()->log_path);
InitializeInterceptors();

View File

@ -312,9 +312,6 @@ void Initialize(ThreadState *thr) {
if (is_initialized)
return;
is_initialized = true;
CheckVMASize();
// We are not ready to handle interceptors yet.
ScopedIgnoreInterceptors ignore;
SanitizerToolName = "ThreadSanitizer";
@ -325,6 +322,7 @@ void Initialize(ThreadState *thr) {
const char *options = GetEnv(kTsanOptionsEnv);
CacheBinaryName();
InitializeFlags(&ctx->flags, options);
CheckVMASize();
#ifndef SANITIZER_GO
InitializeAllocator();
#endif