Github user jeking3 commented on a diff in the pull request: https://github.com/apache/thrift/pull/1128#discussion_r88804076 --- Diff: compiler/cpp/src/thrift/generate/t_erl_generator.cc --- @@ -968,10 +969,13 @@ void t_erl_generator::export_string(string name, int num) { } void t_erl_generator::export_types_function(t_function* tfunction, string prefix) { - + t_struct::members_type::size_type num = tfunction->get_arglist()->get_members().size(); + if (num > std::numeric_limits<int>().max()) { + throw "integer overflow in t_erl_generator::export_types_function, name " + tfunction->get_name(); --- End diff -- Throwing std::string or char * is a pattern used throughout the compiler code. While I agree with you this is not something that should be done, I was following what was already there for continuity and maintainability. I filed https://issues.apache.org/jira/browse/THRIFT-3982 to cover this issue across the compiler codebase. As such, I would like to request this remain.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---