[asan] don't do AsanDie twice

llvm-svn: 150641
This commit is contained in:
Kostya Serebryany 2012-02-16 00:40:18 +00:00
parent 7e14ddd41b
commit 10dbd68bd2
1 changed files with 2 additions and 0 deletions

View File

@ -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);