Skip to content

Commit

Permalink
[fix] Bring calls to SparseStorage constructor up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
misonijnik committed Nov 15, 2023
1 parent 2b513ac commit c1648ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/Solver/CexCachingSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,11 @@ bool CexCachingSolver::computeInitialValues(
// FIXME: We should use smarter assignment for result so we don't
// need redundant copy.
values = std::vector<SparseStorage<unsigned char>>(objects.size());
Assignment::bindings_ty aBindings;
a->tryGetInitialValues(aBindings);

for (unsigned i = 0; i < objects.size(); ++i) {
const Array *os = objects[i];
Assignment::bindings_ty aBindings;
a->tryGetInitialValues(aBindings);
Assignment::bindings_ty::iterator it = aBindings.find(os);

if (it == aBindings.end()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Solver/ConcretizingSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ bool ConcretizingSolver::relaxSymcreteConstraints(const Query &query,
sizeSymcrete->addressSymcrete.symcretized, newSize);
unsigned char *charAddressIterator =
reinterpret_cast<unsigned char *>(&address);
SparseStorage<unsigned char> storage(sizeof(address));
SparseStorage<unsigned char> storage(0);
storage.store(0, charAddressIterator,
charAddressIterator + sizeof(address));

Expand Down
2 changes: 1 addition & 1 deletion lib/Solver/IndependentSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ bool IndependentSolver::computeInitialValues(
dyn_cast<ConstantExpr>(retMap.evaluate(arr->size));
assert(arrayConstantSize &&
"Array of symbolic size had not receive value for size!");
SparseStorage<unsigned char> ret(arrayConstantSize->getZExtValue());
SparseStorage<unsigned char> ret(0);
values.push_back(ret);
} else {
values.push_back(retMap.bindings.at(arr));
Expand Down
2 changes: 1 addition & 1 deletion unittests/Assignment/AssignmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TEST(AssignmentTest, FoldNotOptimized) {
SourceBuilder::makeSymbolic("simple_array", 0));
// Create a simple assignment
std::vector<const Array *> objects;
SparseStorage<unsigned char> value(1);
SparseStorage<unsigned char> value(0);
std::vector<SparseStorage<unsigned char>> values;

objects.push_back(array);
Expand Down

0 comments on commit c1648ab

Please sign in to comment.