diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-11-16 15:42:36 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2021-03-02 16:05:28 +0000 |
commit | 7cc75c9ba38e516067e5a4ab84311c62ddddced7 (patch) | |
tree | f0f5f34a5fdb9d4b1f53955cb2ae6044fa426575 /src/test/fuzz/integer.cpp | |
parent | b9f41df1ead4b6a83a51fc41966b111c8459c313 (diff) |
util: Avoid invalid integer negation in FormatMoney: make FormatMoney(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.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/test/fuzz/integer.cpp b/src/test/fuzz/integer.cpp index ac83d91ea0..30b0fb5bfe 100644 --- a/src/test/fuzz/integer.cpp +++ b/src/test/fuzz/integer.cpp @@ -84,8 +84,7 @@ FUZZ_TARGET_INIT(integer, initialize_integer) (void)DecompressAmount(u64); (void)FormatISO8601Date(i64); (void)FormatISO8601DateTime(i64); - // FormatMoney(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(FormatMoney(i64), parsed_money)) { assert(parsed_money == i64); |