Fix handling of exactly MAX_PACKED_ARGS arguments

This commit is contained in:
vitaut 2015-05-05 10:00:11 -07:00
parent 3c388185c0
commit 11464343a9

View File

@ -1473,7 +1473,8 @@ inline void do_set_types(Arg *args, const T &arg, const Args & ... tail) {
template <typename... Args> template <typename... Args>
inline void set_types(Arg *array, const Args & ... args) { inline void set_types(Arg *array, const Args & ... args) {
do_set_types(array, args...); if (check(sizeof...(Args) > ArgList::MAX_PACKED_ARGS))
do_set_types(array, args...);
array[sizeof...(Args)].type = Arg::NONE; array[sizeof...(Args)].type = Arg::NONE;
} }
@ -1497,7 +1498,7 @@ inline void store_args(Arg *args, const T &arg, const Args & ... tail) {
template <typename Char, typename... Args> template <typename Char, typename... Args>
ArgList make_arg_list(typename ArgArray<sizeof...(Args)>::Type array, ArgList make_arg_list(typename ArgArray<sizeof...(Args)>::Type array,
const Args & ... args) { const Args & ... args) {
if (check(sizeof...(Args) > ArgList::MAX_PACKED_ARGS)) if (check(sizeof...(Args) >= ArgList::MAX_PACKED_ARGS))
set_types(array, args...); set_types(array, args...);
store_args<Char>(array, args...); store_args<Char>(array, args...);
return ArgList(make_type(args...), array); return ArgList(make_type(args...), array);