about summary refs log tree commit diff homepage
path: root/lib/Core/ExecutionState.cpp
diff options
context:
space:
mode:
authorMartin Nowack <martin@se.inf.tu-dresden.de>2016-03-22 17:50:28 +0100
committerMartin Nowack <martin@se.inf.tu-dresden.de>2016-07-08 22:54:54 +0200
commitd06a14dc2ff22da34dbf566a2ad4626c88b0be17 (patch)
tree1b31b82655a0c0003afa2a254aaba551cb67298e /lib/Core/ExecutionState.cpp
parentea0c6724dc992a5358d6da3d50d9f60472d66d64 (diff)
downloadklee-d06a14dc2ff22da34dbf566a2ad4626c88b0be17.tar.gz
Add deterministic allocation of memory
Deterministic allocation provides an internal allocator which
mmaps memory to a fixed static address.
This way, same allocation is assured across different KLEE runs
for the same application assuming a deterministic searcher.

In addition, this patch provides following options:

-allocate-determ: switch on/off deterministic allocation
-allocate-determ-size: adjust preallocated memory
-null-on-zero-malloc: returns null pointer in case a malloc
     of size 0 was requested. According to standard, also a non-null pointer
     can be returned (which happens with the default glibc malloc implementation)
-allocation-space: space between allocations can be adjusted. KLEE is not able
     to detect out-of-bound accesses which are inside another but wrong object.
     Due the implementation of typical allocators adjacent mallocs have space
     in between for management purposes. This spaces helped KLEE to detect off-by-1/2 accesses.
     For higher numbers, the allocation space has to be increased.
-allocate-determ-start-address: adjust deterministic start address. The addres
     has to be page aligned. KLEE fails if it cannot acquire this address
Diffstat (limited to 'lib/Core/ExecutionState.cpp')
-rw-r--r--lib/Core/ExecutionState.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Core/ExecutionState.cpp b/lib/Core/ExecutionState.cpp
index 6aeaa833..30d20266 100644
--- a/lib/Core/ExecutionState.cpp
+++ b/lib/Core/ExecutionState.cpp
@@ -370,8 +370,8 @@ void ExecutionState::dumpStack(llvm::raw_ostream &out) const {
 
       out << ai->getName().str();
       // XXX should go through function
-      ref<Expr> value = sf.locals[sf.kf->getArgRegister(index++)].value; 
-      if (isa<ConstantExpr>(value))
+      ref<Expr> value = sf.locals[sf.kf->getArgRegister(index++)].value;
+      if (value.get() && isa<ConstantExpr>(value))
         out << "=" << value;
     }
     out << ")";