rpc: work around a GCC 7.4.0 (at least) bug

In static member function ‘static boost::optional<cryptonote::rpc::output_distribution_data> cryptonote::rpc::RpcHandler::get_output_distribution(const std::function<bool(long unsigned int, long unsigned int, long unsigned int, long unsigned int&, std::vector<long unsigned int>&, long unsigned int&)>&, uint64_t, uint64_t, uint64_t, const std::function<crypto::hash(long unsigned int)>&, bool, uint64_t)’:
cc1plus: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’: specified size 18446744073709551536 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
This commit is contained in:
moneromooo-monero 2019-06-12 22:26:06 +00:00
parent fd0cf689dd
commit b712ae0af2
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ namespace rpc
d.cached_to -= 10; d.cached_to -= 10;
d.cached_top_hash = hash10; d.cached_top_hash = hash10;
d.cached_m10_hash = crypto::null_hash; d.cached_m10_hash = crypto::null_hash;
d.cached_distribution.resize(d.cached_distribution.size() - 10); CHECK_AND_ASSERT_MES(d.cached_distribution.size() >= 10, boost::none, "Cached distribution size does not match cached bounds");
for (int p = 0; p < 10; ++p)
d.cached_distribution.pop_back();
can_extend = true; can_extend = true;
} }
} }