diff options
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 3907511750..1e879a9166 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -294,7 +294,8 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) { // actually initialize the global after current function has finished // compilation. uint64_t S = getTargetData().getTypeSize(GV->getType()->getElementType()); - Ptr = new char[(size_t)S]; + unsigned char A = getTargetData().getTypeAlignment(GV->getType()->getElementType()); + Ptr = MCE->allocateGlobal(S, A); state.getPendingGlobals(locked).push_back(GV); } addGlobalMapping(GV, Ptr); |