Skip to content

Commit

Permalink
Fix Bitwuzla VARIABLE_NODE translation
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheitman committed Sep 29, 2023
1 parent 8a6ee2f commit f805003
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/libtriton/ast/bitwuzla/tritonToBitwuzla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,20 @@ namespace triton {
return bitwuzla_mk_bv_value(sort->second, triton::utils::toString(value).c_str(), 10);
}

auto n = bitwuzla_mk_const(sort->second, symVar->getName().c_str());
variables[n] = symVar;
auto n = (BitwuzlaTerm) 0;
/* If we already translated the node, return that. */
for (auto it = variables.begin(); it != variables.end(); ++it) {
if (it->second == symVar) {
n = it->first;
break;
}
}

if (n == 0) {
n = bitwuzla_mk_const(sort->second, symVar->getName().c_str());
variables[n] = symVar;
}

return n;
}

Expand Down

0 comments on commit f805003

Please sign in to comment.