From c7a2c02c6bdf038c94a28a0a3f787a1b09d83a62 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Sun, 10 Jul 2016 13:20:44 +0200 Subject: Fix parsing of deterministic address. Allows to provide 0 as an address to allocate deterministic memory area at any free space. --- lib/Core/MemoryManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/Core') diff --git a/lib/Core/MemoryManager.cpp b/lib/Core/MemoryManager.cpp index 004ce090..f9f4b105 100644 --- a/lib/Core/MemoryManager.cpp +++ b/lib/Core/MemoryManager.cpp @@ -44,7 +44,7 @@ llvm::cl::opt RedZoneSpace( "important to detect out-of-bound accesses (default=10)."), llvm::cl::init(10)); -llvm::cl::opt DeterministicStartAddress( +llvm::cl::opt DeterministicStartAddress( "allocate-determ-start-address", llvm::cl::desc("Start address for deterministic allocation. Has to be page " "aligned (default=0x7ff30000000)."), @@ -66,12 +66,11 @@ MemoryManager::MemoryManager(ArrayCache *_arrayCache) if (newSpace == MAP_FAILED) { klee_error("Couldn't mmap() memory for deterministic allocations"); } - if (expectedAddress != newSpace) { + if (expectedAddress != newSpace && expectedAddress != 0) { klee_error("Could not allocate memory deterministically"); } - klee_message("Deterministic memory allocation starting from %p", - expectedAddress); + klee_message("Deterministic memory allocation starting from %p", newSpace); deterministicSpace = newSpace; nextFreeSlot = newSpace; } -- cgit 1.4.1