[llvm] r314413 - [LoopInfo] Don't poison random memory regions.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 05:53:20 PDT 2017


Author: d0k
Date: Thu Sep 28 05:53:20 2017
New Revision: 314413

URL: http://llvm.org/viewvc/llvm-project?rev=314413&view=rev
Log:
[LoopInfo] Don't poison random memory regions.

The second argument for Allocator::Deallocate is the number of elements,
not the size of a single element. In asan mode specifying a large number
of elements poisoned random memory regions, leading to crashes
everywhere.

Modified:
    llvm/trunk/include/llvm/Analysis/LoopInfo.h

Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=314413&r1=314412&r2=314413&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Thu Sep 28 05:53:20 2017
@@ -738,7 +738,7 @@ protected:
 
     // Since LoopAllocator is a BumpPtrAllocator, this Deallocate only poisons
     // \c L, but the pointer remains valid for non-dereferencing uses.
-    LoopAllocator.Deallocate(L, sizeof(LoopT));
+    LoopAllocator.Deallocate(L);
   }
 };
 




More information about the llvm-commits mailing list