[ASan/Win] Unbreak the build after r211216
authorTimur Iskhodzhanov <timurrrr@google.com>
Mon, 7 Jul 2014 16:22:04 +0000 (16:22 +0000)
committerTimur Iskhodzhanov <timurrrr@google.com>
Mon, 7 Jul 2014 16:22:04 +0000 (16:22 +0000)
llvm-svn: 212465

compiler-rt/lib/sanitizer_common/sanitizer_atomic_msvc.h
compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cc

index bff5593..12ffef3 100644 (file)
@@ -33,33 +33,20 @@ long long _InterlockedCompareExchange64(  // NOLINT
     long long volatile *Destination,              // NOLINT
     long long Exchange, long long Comparand);     // NOLINT
 #pragma intrinsic(_InterlockedCompareExchange64)
-
-#ifdef _WIN64
-extern "C" long long _InterlockedExchangeAdd64(     // NOLINT
-    long long volatile * Addend, long long Value);  // NOLINT
-#pragma intrinsic(_InterlockedExchangeAdd64)
 extern "C" void *_InterlockedCompareExchangePointer(
     void *volatile *Destination,
     void *Exchange, void *Comparand);
 #pragma intrinsic(_InterlockedCompareExchangePointer)
-#else
-// There's no _InterlockedCompareExchangePointer intrinsic on x86,
-// so call _InterlockedCompareExchange instead.
 extern "C"
 long __cdecl _InterlockedCompareExchange(  // NOLINT
     long volatile *Destination,            // NOLINT
     long Exchange, long Comparand);        // NOLINT
 #pragma intrinsic(_InterlockedCompareExchange)
 
-inline static void *_InterlockedCompareExchangePointer(
-    void *volatile *Destination,
-    void *Exchange, void *Comparand) {
-  return reinterpret_cast<void*>(
-      _InterlockedCompareExchange(
-          reinterpret_cast<long volatile*>(Destination),  // NOLINT
-          reinterpret_cast<long>(Exchange),               // NOLINT
-          reinterpret_cast<long>(Comparand)));            // NOLINT
-}
+#ifdef _WIN64
+extern "C" long long _InterlockedExchangeAdd64(     // NOLINT
+    long long volatile * Addend, long long Value);  // NOLINT
+#pragma intrinsic(_InterlockedExchangeAdd64)
 #endif
 
 namespace __sanitizer {
index 3b66b8f..b39e3db 100644 (file)
@@ -13,7 +13,7 @@ int main(void) {
 // CHECK: AddressSanitizer: global-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
 // CHECK: READ of size 1 at [[ADDR]] thread T0
 // CHECK-NEXT:   {{#0 .* main .*global_const_string_oob.cc:}}[[@LINE-5]]
-// CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] from {{'.*global_const_string_oob.cc' .*}} of size 11
+// CHECK: [[ADDR]] is located 5 bytes to the right of global variable [[STR:.*]] defined in {{'.*global_const_string_oob.cc:7:.*' .*}} of size 11
 // CHECK:   [[STR]] is ascii string 'foobarspam'
   return 0;
 }