[compiler-rt] r272689 - In asan on Windows 64-bit, this is one of the broken things

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 11:05:45 PDT 2016


Author: etienneb
Date: Tue Jun 14 13:05:45 2016
New Revision: 272689

URL: http://llvm.org/viewvc/llvm-project?rev=272689&view=rev
Log:
In asan on Windows 64-bit, this is one of the broken things
that makes allocation fail. "UL" is 32-bit and shift by 40 will make
the value overflow and become 0.

Patch by Wei Wang

Differential Revision: http://reviews.llvm.org/D21310

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

Modified: compiler-rt/trunk/lib/asan/asan_allocator.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.cc?rev=272689&r1=272688&r2=272689&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.cc Tue Jun 14 13:05:45 2016
@@ -223,7 +223,7 @@ void AllocatorOptions::CopyTo(Flags *f,
 
 struct Allocator {
   static const uptr kMaxAllowedMallocSize =
-      FIRST_32_SECOND_64(3UL << 30, 1UL << 40);
+      FIRST_32_SECOND_64(3UL << 30, 1ULL << 40);
   static const uptr kMaxThreadLocalQuarantine =
       FIRST_32_SECOND_64(1 << 18, 1 << 20);
 




More information about the llvm-commits mailing list