summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-02-16 00:40:18 +0000
committerKostya Serebryany <kcc@google.com>2012-02-16 00:40:18 +0000
commit10dbd68bd2c1c0f76262d80fd951e4810c11f061 (patch)
tree5980aece1bbb85374174639381dffe92d9221811
parent7e14ddd41b91f14e4540617041b87a361feff58d (diff)
downloadbcm5719-llvm-10dbd68bd2c1c0f76262d80fd951e4810c11f061.tar.gz
bcm5719-llvm-10dbd68bd2c1c0f76262d80fd951e4810c11f061.zip
[asan] don't do AsanDie twice
llvm-svn: 150641
-rw-r--r--compiler-rt/lib/asan/asan_rtl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc
index b8c485e3458..70e4383ce52 100644
--- a/compiler-rt/lib/asan/asan_rtl.cc
+++ b/compiler-rt/lib/asan/asan_rtl.cc
@@ -102,6 +102,8 @@ size_t ReadFileToBuffer(const char *file_name, char **buff,
}
void AsanDie() {
+ static int num_calls = 0;
+ if (AtomicInc(&num_calls) > 1) return; // Don't die twice.
if (FLAG_sleep_before_dying) {
Report("Sleeping for %d second(s)\n", FLAG_sleep_before_dying);
SleepForSeconds(FLAG_sleep_before_dying);
OpenPOWER on IntegriCloud