We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c82b6db commit df08efcCopy full SHA for df08efc
llvm/lib/Support/Allocator.cpp
@@ -15,6 +15,7 @@
15
#include "llvm/Support/DataTypes.h"
16
#include "llvm/Support/Recycler.h"
17
#include "llvm/Support/raw_ostream.h"
18
+#include "llvm/System/Memory.h"
19
#include <cstring>
20
21
namespace llvm {
@@ -60,6 +61,7 @@ void BumpPtrAllocator::DeallocateSlabs(MemSlab *Slab) {
60
61
#ifndef NDEBUG
62
// Poison the memory so stale pointers crash sooner. Note we must
63
// preserve the Size and NextPtr fields at the beginning.
64
+ sys::Memory::setRangeWritable(Slab + 1, Slab->Size - sizeof(MemSlab));
65
memset(Slab + 1, 0xCD, Slab->Size - sizeof(MemSlab));
66
#endif
67
Allocator.Deallocate(Slab);
0 commit comments