From ea0c6724dc992a5358d6da3d50d9f60472d66d64 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 22 Mar 2016 17:16:38 +0100 Subject: Handle aligned varargs allignment correctly For vararg handling, arguments of size bigger than 64 bit need to be handled 128bit aligned according to AMD calling conventions AMD64-ABI 3.5.7p5. To handle that case correctly, we do: 1) make sure that every argument is aligned correctly in an allocation for function arguments 2) the allocation itself is aligned correctly --- lib/Core/MemoryManager.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Core/MemoryManager.h') diff --git a/lib/Core/MemoryManager.h b/lib/Core/MemoryManager.h index 01683443..d80e44af 100644 --- a/lib/Core/MemoryManager.h +++ b/lib/Core/MemoryManager.h @@ -31,8 +31,12 @@ namespace klee { MemoryManager(ArrayCache *arrayCache) : arrayCache(arrayCache) {} ~MemoryManager(); + /** + * Returns memory object which contains a handle to real virtual process + * memory. + */ MemoryObject *allocate(uint64_t size, bool isLocal, bool isGlobal, - const llvm::Value *allocSite); + const llvm::Value *allocSite, size_t alignment = 8); MemoryObject *allocateFixed(uint64_t address, uint64_t size, const llvm::Value *allocSite); void deallocate(const MemoryObject *mo); -- cgit 1.4.1