mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
util: Avoid invalid integer negation in ValueFromAmount: make ValueFromAmount(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min()
This commit is contained in:
@@ -131,8 +131,7 @@ FUZZ_TARGET_INIT(integer, initialize_integer)
|
||||
(void)SipHashUint256Extra(u64, u64, u256, u32);
|
||||
(void)ToLower(ch);
|
||||
(void)ToUpper(ch);
|
||||
// ValueFromAmount(i) not defined when i == std::numeric_limits<int64_t>::min()
|
||||
if (i64 != std::numeric_limits<int64_t>::min()) {
|
||||
{
|
||||
int64_t parsed_money;
|
||||
if (ParseMoney(ValueFromAmount(i64).getValStr(), parsed_money)) {
|
||||
assert(parsed_money == i64);
|
||||
|
||||
Reference in New Issue
Block a user