]> granicus.if.org Git - llvm/commitdiff
[LoopInfo] Don't poison random memory regions.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 28 Sep 2017 12:53:20 +0000 (12:53 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 28 Sep 2017 12:53:20 +0000 (12:53 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314413 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index cb0db27ed83e3fc1ca6f204572afdb0b22864c14..4d3da873ac55e166b8372a5ff650b96e447bf19d 100644 (file)
@@ -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);
   }
 };