mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02: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:
parent
7cc75c9ba3
commit
1f05dbd06d
5 changed files with 25 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue