fix variable_info.cpp

variable_as_array_h::operator() expects the range to be passed as a pair (startindex, endindex). We accidentally passed the range as (startindex, size) instead.

Shadowm reported bugs related to global variables but most likely this can also lead to segfaults in other situations (some uses of [set_variables]).
This commit is contained in:
gfgtdf 2014-11-13 14:12:50 +01:00
parent d0623f16da
commit c64a1925df

View file

@ -395,7 +395,7 @@ namespace {
}
/// variable_as_array_h only uses the template argument (vit_throw_if_not_existent here)
/// to determine constness which is always false here
return variable_as_array_h<vit_throw_if_not_existent>()(child, key, startindex, datasource_.size());
return variable_as_array_h<vit_throw_if_not_existent>()(child, key, startindex, startindex + datasource_.size());
}
private:
std::vector<config>& datasource_;