diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -347,7 +347,7 @@ tx.vout[0].nValue = i * SATOSHI; // Random sizes so we can test memory usage accounting tx.vout[0].scriptPubKey.assign(InsecureRand32() & 0x3F, 0); - unsigned int height = InsecureRand32(); + const int height{int(InsecureRand32()) >> 1}; Coin old_coin; // 2/20 times create a new coinbase @@ -421,11 +421,11 @@ assert(tx.vout.size() == 1); const COutPoint outpoint(tx.GetId(), 0); result[outpoint] = - Coin(tx.vout[0], height, CTransaction(tx).IsCoinBase()); + Coin(tx.vout[0], height, CTransaction{tx}.IsCoinBase()); // Call UpdateCoins on the top cache CTxUndo undo; - UpdateCoins(*(stack.back()), CTransaction(tx), undo, height); + UpdateCoins(*(stack.back()), CTransaction{tx}, undo, height); // Update the utxo set for future spends utxoset.insert(outpoint); diff --git a/src/test/fuzz/coins_view.cpp b/src/test/fuzz/coins_view.cpp --- a/src/test/fuzz/coins_view.cpp +++ b/src/test/fuzz/coins_view.cpp @@ -253,7 +253,8 @@ break; } bool expected_code_path = false; - const int height = fuzzed_data_provider.ConsumeIntegral(); + const int height{ + int(fuzzed_data_provider.ConsumeIntegral() >> 1)}; const bool possible_overwrite = fuzzed_data_provider.ConsumeBool(); try { diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -37,7 +37,6 @@ implicit-integer-sign-change:*/new_allocator.h implicit-integer-sign-change:/usr/include/boost/date_time/format_date_parser.hpp implicit-integer-sign-change:bech32.cpp -implicit-integer-sign-change:coins.h implicit-integer-sign-change:compat/stdin.cpp implicit-integer-sign-change:compressor.h implicit-integer-sign-change:crypto/*