Out-of-range access when adding functions to the shunting yard parser on the fly
I was notified that Kira with FireFly crashes with an std::out_of_range
when reading in the equations where it uses ShuntingYardParser::add_otf(std::string& fun, const bool no_duplicates)
. It can be reproduced by replacing values[XXX]
by values.at(XXX)
in ShuntingYardParser::evaluate(const std::vector<std::string>& fun, const std::vector<FFInt>& values)
in source/ShuntingYardParser.cpp
. The reason for this is that check_vars_1
and check_vars_2
are cleared in ShuntingYardParser::precompute_tokens(bool force)
.