summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-19 10:31:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-19 10:31:50 +0000
commit902a7b529820e6a0aa85f98f21afaeb1805a22f8 (patch)
treee7da40d2f6ef824f7371860826845870e6e1dcd5 /lib/ExecutionEngine/JIT/JITMemoryManager.cpp
parent58b69754af0cbff56b1cfce9be9392e4451f6628 (diff)
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITMemoryManager.cpp')
-rw-r--r--lib/ExecutionEngine/JIT/JITMemoryManager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index 7be6ef8cba937..61bc119d305ba 100644
--- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -461,6 +461,9 @@ namespace {
/// allocateCodeSection - Allocate memory for a code section.
uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID) {
+ // Grow the required block size to account for the block header
+ Size += sizeof(*CurBlock);
+
// FIXME: Alignement handling.
FreeRangeHeader* candidateBlock = FreeMemoryList;
FreeRangeHeader* head = FreeMemoryList;