Skip to content

Commit

Permalink
Merge pull request JonathanSalwan#1289 from cnheitman/fix/fix-bitwuzl…
Browse files Browse the repository at this point in the history
…a-translation

Fix Bitwuzla VARIABLE_NODE translation
  • Loading branch information
JonathanSalwan authored Sep 30, 2023
2 parents 8a6ee2f + f805003 commit adbc863
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 adbc863

Please sign in to comment.