Fix a bug where the DWARF emitter in the JIT was not initializing alignment

bytes.  libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it
doesn't like it.  

Also make the JIT memory manager to initialize it's memory to garbage in debug
mode, so that it's easier to find bugs like these in the future.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2009-08-21 21:03:57 +00:00
parent c692cb77aa
commit 01248e6711
4 changed files with 40 additions and 35 deletions

View File

@ -650,6 +650,10 @@ sys::MemoryBlock DefaultJITMemoryManager::allocateNewSlab(size_t size) {
}
LastSlab = B;
++NumSlabs;
// Initialize the slab to garbage when debugging.
if (PoisonMemory) {
memset(B.base(), 0xCD, B.size());
}
return B;
}