Skip to content
Snippets Groups Projects
Verified Commit fff9ffc5 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

:bug: Fix handling of model local variable in DataTree copy constructor

Implement the fix that is already present in assignment operator (in particular
for dynare#1782).
parent 5da05127
Branches
No related tags found
No related merge requests found
Pipeline #11504 passed
......@@ -70,13 +70,14 @@ DataTree::DataTree(const DataTree& d) :
// Constants must be initialized first because they are used in some Add* methods
initConstants();
// See commment in DataTree::operator=() for the rationale
for (int symb_id : d.local_variables_vector)
local_variables_table[symb_id] = d.local_variables_table.at(symb_id)->clone(*this);
for (const auto& it : d.node_list)
it->clone(*this);
assert(node_list.size() == d.node_list.size());
for (const auto& [symb_id, value] : d.local_variables_table)
local_variables_table[symb_id] = value->clone(*this);
}
DataTree&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment