fix(frontends/lean/parser): uninitialized var error reported by valgrind

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-01-15 08:43:43 -08:00
parent 28eb980484
commit 83efa644d1

View file

@ -166,6 +166,10 @@ parser_imp::parser_imp(environment const & env, io_state const & st, std::istrea
m_tactic_macros = nullptr;
m_cmd_macros = nullptr;
}
// Initialize m_curr with some value. We need that because scan()
// may fail, and m_curr will remain uninitialized.
// In thi case, Valgrind would report unit var errors.
m_curr = scanner::token::Id;
protected_call([&]() { scan(); },
[&]() { sync_command(); });
}