[llvm-commits] [compiler-rt] r150641 - /compiler-rt/trunk/lib/asan/asan_rtl.cc

Kostya Serebryany kcc at google.com
Wed Feb 15 16:40:19 PST 2012


Author: kcc
Date: Wed Feb 15 18:40:18 2012
New Revision: 150641

URL: http://llvm.org/viewvc/llvm-project?rev=150641&view=rev
Log:
[asan] don't do AsanDie twice

Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=150641&r1=150640&r2=150641&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed Feb 15 18:40:18 2012
@@ -102,6 +102,8 @@
 }
 
 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);





More information about the llvm-commits mailing list