aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/integer.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-11-16 16:44:50 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2021-03-02 16:05:28 +0000
commit1f05dbd06d896849d16b026bfc3315ee8b73a89f (patch)
treeeda7a641dfa820f8c7f39cada9f04f28a547f663 /src/test/fuzz/integer.cpp
parent7cc75c9ba38e516067e5a4ab84311c62ddddced7 (diff)
downloadbitcoin-1f05dbd06d896849d16b026bfc3315ee8b73a89f.tar.xz
util: Avoid invalid integer negation in ValueFromAmount: make ValueFromAmount(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min()
Diffstat (limited to 'src/test/fuzz/integer.cpp')
-rw-r--r--src/test/fuzz/integer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp
index 30b0fb5bfe..5bc99ddcb9 100644
--- a/src/test/fuzz/integer.cpp
+++ b/src/test/fuzz/integer.cpp
@@ -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);