[compiler-rt] r208673 - [sanitizer] fix for ARM Linux, patch by Maxim Ostapenko

Kostya Serebryany kcc at google.com
Tue May 13 01:01:59 PDT 2014


Author: kcc
Date: Tue May 13 03:01:59 2014
New Revision: 208673

URL: http://llvm.org/viewvc/llvm-project?rev=208673&view=rev
Log:
[sanitizer] fix for ARM Linux, patch by Maxim Ostapenko

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_clang_other.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_clang_other.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_clang_other.h?rev=208673&r1=208672&r2=208673&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_clang_other.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_clang_other.h Tue May 13 03:01:59 2014
@@ -53,7 +53,8 @@ INLINE typename T::Type atomic_load(
     // 64-bit load on 32-bit platform.
     // Gross, but simple and reliable.
     // Assume that it is not in read-only memory.
-    v = __sync_fetch_and_add((typename T::Type volatile*)&a->val_dont_use, 0);
+    v = __sync_fetch_and_add(
+        const_cast<typename T::Type volatile *>(&a->val_dont_use), 0);
   }
   return v;
 }

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=208673&r1=208672&r2=208673&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Tue May 13 03:01:59 2014
@@ -275,10 +275,17 @@ namespace __sanitizer {
 #endif
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
+
+#if defined(__arm__)
+  const unsigned kXDROpsNumFuns = 9;
+#else
+  const unsigned kXDROpsNumFuns = 10;
+#endif
+
   struct __sanitizer_XDR {
     int x_op;
     struct xdr_ops {
-      uptr fns[10];
+      uptr fns[kXDROpsNumFuns];
     } *x_ops;
     uptr x_public;
     uptr x_private;





More information about the llvm-commits mailing list