Term::Term() : d_solver(nullptr), d_node(new CVC4::Node()) {}
Term::Term(const Solver* slv, const CVC4::Expr& e)
- : d_solver(slv), d_node(new CVC4::Node(e))
+ : d_solver(slv)
{
+ // Ensure that we create the node in the correct node manager.
+ NodeManagerScope scope(d_solver->getNodeManager());
+ d_node.reset(new CVC4::Node(e));
}
Term::Term(const Solver* slv, const CVC4::Node& n)
- : d_solver(slv), d_node(new CVC4::Node(n))
+ : d_solver(slv)
{
+ // Ensure that we create the node in the correct node manager.
+ NodeManagerScope scope(d_solver->getNodeManager());
+ d_node.reset(new CVC4::Node(n));
}
Term::~Term()