From 902a7b529820e6a0aa85f98f21afaeb1805a22f8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 19 Aug 2012 10:31:50 +0000 Subject: Vendor import of llvm trunk r162107: http://llvm.org/svn/llvm-project/llvm/trunk@162107 --- lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/ExecutionEngine/JIT/JITMemoryManager.cpp') 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; -- cgit v1.2.3