The recent enum change was causing t_enum::get_constant_by_name to fail
in t_const_value::get_integer. This was causing a difficult-to-debug
segfault. Check for failure and throw an exeception.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996609
13f79535-47bb-0310-9956-
ffa450edef68
throw "have identifier \"" + get_identifier() + "\", but unset enum on line!";
}
t_enum_value* val = enum_->get_constant_by_name(get_identifier());
+ if (val == NULL) {
+ throw
+ "Unable to find enum value \"" + get_identifier() +
+ "\" in enum \"" + enum_->get_name() + "\"";
+ }
return val->get_value();
} else {
return intVal_;