aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Core
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-10 06:23:00 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-10 06:23:00 +0000
commit876a9e45740b09a8518bef438f1e895c9f416be3 (patch)
tree95f1ec79e942fd302954bc9faed0275650122ab5 /lib/Core
parent7561acc8b346028bc6eb586ea76b5b2a9400140c (diff)
downloadklee-876a9e45740b09a8518bef438f1e895c9f416be3.tar.gz
Move Array construction out of MemoryObject into ObjectState.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/Memory.cpp13
-rw-r--r--lib/Core/Memory.h3
2 files changed, 2 insertions, 14 deletions
diff --git a/lib/Core/Memory.cpp b/lib/Core/Memory.cpp
index ba1b8e1f..513c2177 100644
--- a/lib/Core/Memory.cpp
+++ b/lib/Core/Memory.cpp
@@ -57,16 +57,6 @@ int MemoryObject::counter = 0;
extern "C" void vc_DeleteExpr(void*);
MemoryObject::~MemoryObject() {
- // FIXME: This shouldn't be necessary. Array's should be ref-counted
- // just like everything else, and the interaction with the STP array
- // should hide at least inside the Expr/Solver layers.
- if (array) {
- if (array->stpInitialArray) {
- ::vc_DeleteExpr(array->stpInitialArray);
- array->stpInitialArray = 0;
- }
- delete array;
- }
}
void MemoryObject::getAllocInfo(std::string &result) const {
@@ -102,7 +92,8 @@ ObjectState::ObjectState(const MemoryObject *mo, unsigned _size)
flushMask(0),
knownSymbolics(0),
size(_size),
- updates(mo->array, 0),
+ // FIXME: Leaked!
+ updates(new Array("arr" + llvm::utostr(mo->id), _size), 0),
readOnly(false) {
}
diff --git a/lib/Core/Memory.h b/lib/Core/Memory.h
index b6ea81d7..565572be 100644
--- a/lib/Core/Memory.h
+++ b/lib/Core/Memory.h
@@ -36,7 +36,6 @@ private:
public:
unsigned id;
uint64_t address;
- Array *array;
/// size in bytes
unsigned size;
@@ -71,7 +70,6 @@ public:
MemoryObject(uint64_t _address)
: id(counter++),
address(_address),
- array(new Array("arr" + llvm::utostr(id), id)),
size(0),
isFixed(true),
allocSite(0) {
@@ -82,7 +80,6 @@ public:
const llvm::Value *_allocSite)
: id(counter++),
address(_address),
- array(new Array("arr" + llvm::utostr(id), _size)),
size(_size),
name("unnamed"),
isLocal(_isLocal),