about summary refs log tree commit diff homepage
path: root/lib/Core/ExecutionState.cpp
diff options
context:
space:
mode:
authorLukáš Zaoral <lzaoral@redhat.com>2022-01-22 21:27:43 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2022-03-09 20:45:11 +0100
commit69190130d38bfc9b5d67add843f2c542dc843470 (patch)
tree45200c5197b071230b1b6db94222978ebb5ca4c7 /lib/Core/ExecutionState.cpp
parent7c80e9b86c89f5a87dcd5347b94fbb32b4137e2f (diff)
downloadklee-69190130d38bfc9b5d67add843f2c542dc843470.tar.gz
Core/ExecutionState: Fix uninitialized reads in unit tests
... by initialising all members of fundamental types of the ExecutionState
class.

Fixes the following error in SearcherTest.{Two,}RandomPath unit tests:
lib/Core/ExecutionState.cpp:114:22: runtime error: load of value 254, which is not a valid value for type 'bool'
Diffstat (limited to 'lib/Core/ExecutionState.cpp')
-rw-r--r--lib/Core/ExecutionState.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/Core/ExecutionState.cpp b/lib/Core/ExecutionState.cpp
index 2f585f96..54fe752e 100644
--- a/lib/Core/ExecutionState.cpp
+++ b/lib/Core/ExecutionState.cpp
@@ -70,15 +70,8 @@ StackFrame::~StackFrame() {
 
 /***/
 
-ExecutionState::ExecutionState(KFunction *kf) :
-    pc(kf->instructions),
-    prevPC(pc),
-    depth(0),
-    ptreeNode(nullptr),
-    steppedInstructions(0),
-    instsSinceCovNew(0),
-    coveredNew(false),
-    forkDisabled(false) {
+ExecutionState::ExecutionState(KFunction *kf)
+    : pc(kf->instructions), prevPC(pc) {
   pushFrame(nullptr, kf);
   setID();
 }