summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-12 00:03:12 +0000
committerChris Lattner <sabre@nondot.org>2006-05-12 00:03:12 +0000
commit22acb80971f3bd32435686fb7c27b11fe92cdbfc (patch)
treec70e7bd1979ef0f1c8df810ee79dddbdd4dbbb0e /llvm/lib
parent3c729b9e5d7a8e6987a505a60ec5d82495e994ef (diff)
downloadbcm5719-llvm-22acb80971f3bd32435686fb7c27b11fe92cdbfc.tar.gz
bcm5719-llvm-22acb80971f3bd32435686fb7c27b11fe92cdbfc.zip
For extra sanity checking, fill free'd memory with garbage so we know that
people aren't reusing machine code buffers at all. llvm-svn: 28228
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
index efc2062a544..2a62bd3557c 100644
--- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -321,6 +321,9 @@ namespace {
MemoryRangeHeader *MemRange = I->second;
assert(MemRange->ThisAllocated && "Block isn't allocated!");
+ // Fill the buffer with garbage!
+ DEBUG(memset(MemRange+1, 0xCD, MemRange->BlockSize-sizeof(*MemRange)));
+
// Free the memory.
FreeMemoryList = MemRange->FreeBlock(FreeMemoryList);
OpenPOWER on IntegriCloud