[compiler-rt] r181992 - [sanitizer] fix a gcc warning

Kostya Serebryany kcc at google.com
Thu May 16 01:03:55 PDT 2013


Author: kcc
Date: Thu May 16 03:03:26 2013
New Revision: 181992

URL: http://llvm.org/viewvc/llvm-project?rev=181992&view=rev
Log:
[sanitizer] fix a gcc warning

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h?rev=181992&r1=181991&r2=181992&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h Thu May 16 03:03:26 2013
@@ -495,7 +495,7 @@ class SizeClassAllocator64 {
     uptr offset = chunk % kRegionSize;
     // Here we divide by a non-constant. This is costly.
     // size always fits into 32-bits. If the offset fits too, use 32-bit div.
-    if (offset >> 32)
+    if (offset >> (SANITIZER_WORDSIZE / 2))
       return offset / size;
     return (u32)offset / (u32)size;
   }





More information about the llvm-commits mailing list