diff --git a/libraries/wallet/include/graphene/wallet/reflect_util.hpp b/libraries/wallet/include/graphene/wallet/reflect_util.hpp index 6a138e1e10..7a9e6e0812 100644 --- a/libraries/wallet/include/graphene/wallet/reflect_util.hpp +++ b/libraries/wallet/include/graphene/wallet/reflect_util.hpp @@ -61,14 +61,14 @@ struct static_variant_map_visitor template< typename T > result_type operator()( const T& dummy ) { - assert( which == m.which_to_name.size() ); + FC_ASSERT( which == m.which_to_name.size(), "This should not happen" ); std::string name = clean_name( fc::get_typename::name() ); m.name_to_which[ name ] = which; m.which_to_name.push_back( name ); } static_variant_map m; - int which; + uint16_t which; // 16 bit should be practically enough }; template< typename StaticVariant > @@ -107,6 +107,7 @@ static_variant_map create_static_variant_map() { T dummy; int n = dummy.count(); + FC_ASSERT( n <= std::numeric_limits::max(), "Too many items in this static_variant" ); impl::static_variant_map_visitor vtor; for( int i=0; i