Fix WFL debug output using an invalid vector

This commit is contained in:
Celtic Minstrel 2017-04-11 00:45:51 -04:00
parent 169cc9245e
commit aefbea950b
2 changed files with 3 additions and 1 deletions

View file

@ -650,7 +650,7 @@ std::string variant::to_debug_string(bool verbose, formula_seen_stack* seen) con
{
if(!seen) {
formula_seen_stack seen_stack;
seen = &seen_stack;
return value_->get_debug_string(seen_stack, verbose);
}
return value_->get_debug_string(*seen, verbose);

View file

@ -192,6 +192,8 @@ inline int typed_formula<int>::execute(wfl::variant& v) const
template<>
inline unsigned typed_formula<unsigned>::execute(wfl::variant& v) const
{
// FIXME: Validate this? As is, the formula could return a negative number which is blindly converted to unsigned.
// Unfortunately, some places rely on this happening for diagnostic messages...
return v.as_int();
}