Skip to content
Snippets Groups Projects
Commit 60c094b8 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fix symbol clean-up

Replace old values (when leaving a block) by default (constructor)
values. This was buggy since old values were replaced by a
`std::monostate` which led to inconsistent state of local variables.
parent ca79a51f
Branches
Tags
1 merge request!54Feature/language coverage
......@@ -267,7 +267,12 @@ class SymbolTable
clearValues()
{
for (auto& symbol : m_symbol_list) {
symbol.attributes().value() = DataVariant{};
std::visit(
[](auto&& value) {
using T = std::decay_t<decltype(value)>;
value = T{};
},
symbol.attributes().value());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment