Skip to content

Commit

Permalink
THRIFT-4134-Fix-remaining-undefined-behavior-invalid.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens-G committed Mar 26, 2017
1 parent d915238 commit d58a0b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/cpp/src/thrift/parse/t_scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,18 @@ class t_scope {
resolve_const_value(v_iter->first, ((t_map*)ttype)->get_key_type());
resolve_const_value(v_iter->second, ((t_map*)ttype)->get_val_type());
}
} else if (ttype->is_list() || ttype->is_set()) {
} else if (ttype->is_list()) {
const std::vector<t_const_value*>& val = const_val->get_list();
std::vector<t_const_value*>::const_iterator v_iter;
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
resolve_const_value((*v_iter), ((t_list*)ttype)->get_elem_type());
}
} else if (ttype->is_set()) {
const std::vector<t_const_value*>& val = const_val->get_list();
std::vector<t_const_value*>::const_iterator v_iter;
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
resolve_const_value((*v_iter), ((t_set*)ttype)->get_elem_type());
}
} else if (ttype->is_struct()) {
t_struct* tstruct = (t_struct*)ttype;
const std::map<t_const_value*, t_const_value*>& map = const_val->get_map();
Expand Down

0 comments on commit d58a0b7

Please sign in to comment.