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

Fix storage of non initialized variables

parent d54056a4
No related branches found
No related tags found
1 merge request!199Integrate checkpointing
......@@ -314,7 +314,7 @@ class SymbolTable
}
std::vector<Symbol>
getBuiltinFunctionSymbolList(const std::string& symbol, const TAO_PEGTL_NAMESPACE::position& use_position)
getBuiltinFunctionSymbolList(const std::string& symbol, const TAO_PEGTL_NAMESPACE::position& use_position) const
{
std::vector<Symbol> builtin_function_symbol_list;
......@@ -338,7 +338,7 @@ class SymbolTable
}
bool
has(const std::string& symbol, const TAO_PEGTL_NAMESPACE::position& use_position)
has(const std::string& symbol, const TAO_PEGTL_NAMESPACE::position& use_position) const
{
for (auto i_stored_symbol : m_symbol_list) {
// Symbol must be defined before the call
......
......@@ -54,7 +54,8 @@ checkpoint()
break;
}
default: {
if ((symbol.attributes().dataType() != ASTNodeDataType::builtin_function_t) and
if ((symbol_table.has(symbol.name(), ASTExecutionStack::getInstance().currentNode().begin())) and
(symbol.attributes().dataType() != ASTNodeDataType::builtin_function_t) and
(not symbol.attributes().isModuleVariable())) {
std::visit(
[&](auto&& data) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment