[compiler-rt] r212465 - [ASan/Win] Unbreak the build after r211216

Timur Iskhodzhanov timurrrr at google.com
Mon Jul 7 09:22:04 PDT 2014


Author: timurrrr
Date: Mon Jul  7 11:22:04 2014
New Revision: 212465

URL: http://llvm.org/viewvc/llvm-project?rev=212465&view=rev
Log:
[ASan/Win] Unbreak the build after r211216

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h?rev=212465&r1=212464&r2=212465&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h Mon Jul  7 11:22:04 2014
@@ -33,33 +33,20 @@ long long _InterlockedCompareExchange64(
     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 {

Modified: compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string_oob.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string_oob.cc?rev=212465&r1=212464&r2=212465&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string_oob.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/global_const_string_oob.cc Mon Jul  7 11:22:04 2014
@@ -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;
 }





More information about the llvm-commits mailing list