From 41ee94afe029c891e8960141ba71a3451a42d6ae Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Mon, 4 Nov 2019 16:42:51 +0000 Subject: Use `ref<>` for MemoryObject handling This uses the `ref<>`-based memory handling of MemoryObjects. This makes it explicit that references are held in: - ExecutionState::symbolics - ObjectState --- lib/Core/Memory.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'lib/Core/Memory.cpp') diff --git a/lib/Core/Memory.cpp b/lib/Core/Memory.cpp index 37e6646b..ce537a4c 100644 --- a/lib/Core/Memory.cpp +++ b/lib/Core/Memory.cpp @@ -82,7 +82,6 @@ ObjectState::ObjectState(const MemoryObject *mo) updates(0, 0), size(mo->size), readOnly(false) { - mo->refCount++; if (!UseConstantArrays) { static unsigned id = 0; const Array *array = @@ -103,7 +102,6 @@ ObjectState::ObjectState(const MemoryObject *mo, const Array *array) updates(array, 0), size(mo->size), readOnly(false) { - mo->refCount++; makeSymbolic(); memset(concreteStore, 0, size); } @@ -119,9 +117,6 @@ ObjectState::ObjectState(const ObjectState &os) size(os.size), readOnly(false) { assert(!os.readOnly && "no need to copy read only object?"); - if (object) - object->refCount++; - if (os.knownSymbolics) { knownSymbolics = new ref[size]; for (unsigned i=0; irefCount > 0); - object->refCount--; - if (object->refCount == 0) - { - delete object; - } - } } ArrayCache *ObjectState::getArrayCache() const { - assert(object && "object was NULL"); + assert(!object.isNull() && "object was NULL"); return object->parent->getArrayCache(); } -- cgit 1.4.1