Skip to content
Snippets Groups Projects

Fix a vicious bug in symbol table management

1 file
+ 9
6
Compare changes
  • Side-by-side
  • Inline
+ 9
6
@@ -267,12 +267,15 @@ class SymbolTable
@@ -267,12 +267,15 @@ class SymbolTable
clearValues()
clearValues()
{
{
for (auto& symbol : m_symbol_list) {
for (auto& symbol : m_symbol_list) {
std::visit(
// local functions must kept their values (id)
[](auto&& value) {
if (symbol.attributes().dataType() != ASTNodeDataType::function_t) {
using T = std::decay_t<decltype(value)>;
std::visit(
value = T{};
[](auto&& value) {
},
using T = std::decay_t<decltype(value)>;
symbol.attributes().value());
value = T{};
 
},
 
symbol.attributes().value());
 
}
}
}
}
}
Loading