Jinja2Cpp
Jinja2Cpp copied to clipboard
Bug in 'reverse' filter
std::vector<std::string> foundTypes;
jinja2::ValuesMap renderParams =
{ { "specTypes" , jinja2::Reflect(&foundTypes) }
};
// ...
if (...)
{
foundTypes = ...
renderParams["specTypes"] = jinja2::Reflect(&foundTypes);
}
Also, simple jinja makes the same effect:
{{ [3, 1, 2] | reverse }}
produces the bad_expected_access exception, which inspired by std::bad_alloc exception
// filters.cpp:452
InternalValue SequenceAccessor::Filter(const InternalValue& baseVal, RenderContext& context)
//...
// filters.cpp:479
listSize = {has_value_=true (0x34) contained={data={_Val=6.951334341138e-310#DEN _Pad=0x000000750f548880 "\x1ЉGyц" } } }
// 0x34 - 52 - size of my data vector
// requested size: size = 0x00007ff679478a01
// hex representation of 6.951334341138e-310 double is 0x00007ff679478a01