[compiler-rt] r199544 - [asan] use correct type when computing shadow address in allocator (caused SEGV when asan run-time is built with gcc 4.8.2 on 32-bit arch)

Kostya Serebryany kcc at google.com
Sat Jan 18 01:38:32 PST 2014


Author: kcc
Date: Sat Jan 18 03:38:31 2014
New Revision: 199544

URL: http://llvm.org/viewvc/llvm-project?rev=199544&view=rev
Log:
[asan] use correct type when computing shadow address in allocator (caused SEGV when asan run-time is built with gcc 4.8.2 on 32-bit arch)

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

Modified: compiler-rt/trunk/lib/asan/asan_allocator2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator2.cc?rev=199544&r1=199543&r2=199544&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator2.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator2.cc Sat Jan 18 03:38:31 2014
@@ -358,7 +358,7 @@ static void *Allocate(uptr size, uptr al
     allocated = allocator.Allocate(cache, needed_size, 8, false);
   }
 
-  if (*(u8 *)MEM_TO_SHADOW((u64)allocated) == 0 && flags()->poison_heap) {
+  if (*(u8 *)MEM_TO_SHADOW((uptr)allocated) == 0 && flags()->poison_heap) {
     // Heap poisoning is enabled, but the allocator provides an unpoisoned
     // chunk. This is possible if flags()->poison_heap was disabled for some
     // time, for example, due to flags()->start_disabled.





More information about the llvm-commits mailing list