Skip to content

Commit

Permalink
fix variable_info.cpp
Browse files Browse the repository at this point in the history
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]).
  • Loading branch information
gfgtdf committed Nov 13, 2014
1 parent d0623f1 commit c64a192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/variable_info.cpp
Expand Up @@ -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_;
Expand Down

0 comments on commit c64a192

Please sign in to comment.