diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-12-19 20:35:53 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-12-19 20:35:53 +0000 |
commit | a7d265546807ffc763cb634fe0c1efaa74955ed9 (patch) | |
tree | 389f65c773434317dbf23724d6eadb94f7089d42 /lib/asan/asan_rtl.cc | |
parent | 262ebb726c15f7d11fe24566b6486fe4422b97a4 (diff) |
[ASan] Change activation strategy.
Now ASan deactivation doesn't modify common or ASan-specific runtime
flags. Flags stay constant after initialization, and "deactivation"
instead stashes initialized runtime state, and deactivates the
runtime. Activation then just restores the original state (possibly,
overriden by some activation flags provided in system property on
Android).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_rtl.cc')
-rw-r--r-- | lib/asan/asan_rtl.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc index e1c8769a8..895ac6bf7 100644 --- a/lib/asan/asan_rtl.cc +++ b/lib/asan/asan_rtl.cc @@ -397,6 +397,11 @@ static void AsanInitInternal() { MaybeStartBackgroudThread(); + // Now that ASan runtime is (mostly) initialized, deactivate it if + // necessary, so that it can be re-activated when requested. + if (flags()->start_deactivated) + AsanDeactivate(); + // On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited // should be set to 1 prior to initializing the threads. asan_inited = 1; |