0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Merge bitcoin/bitcoin#24146: Avoid integer sanitizer warnings in chain.o

fa832103aa Avoid integer sanitizer warnings in chain.o (MarcoFalke)

Pull request description:

  The two changes make the code more self-documenting and also allow to remove 5 file-wide suppressions for the module

ACKs for top commit:
  PastaPastaPasta:
    utACK fa832103aa
  jonatack:
    ACK fa832103aa

Tree-SHA512: d32a06099c56eed9f69130a3209f989872acc593f849528acd7746ee6caa96688cc32de37e8e59ad5d25dcb8912e341f1a43e50642dadeff6ca7624d0873ad10
This commit is contained in:
MarcoFalke 2022-01-31 09:23:49 +01:00
commit b25a752dfd
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 2 additions and 8 deletions

View file

@ -151,7 +151,7 @@ int64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& fr
if (r.bits() > 63) {
return sign * std::numeric_limits<int64_t>::max();
}
return sign * r.GetLow64();
return sign * int64_t(r.GetLow64());
}
/** Find the last common ancestor two blocks have.

View file

@ -475,7 +475,7 @@ public:
/** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */
int Height() const
{
return vChain.size() - 1;
return int(vChain.size()) - 1;
}
/** Set/initialize a chain with a given tip. */

View file

@ -46,8 +46,6 @@ shift-base:test/fuzz/crypto_diff_fuzz_chacha20.cpp
unsigned-integer-overflow:addrman.cpp
unsigned-integer-overflow:arith_uint256.h
unsigned-integer-overflow:common/bloom.cpp
unsigned-integer-overflow:chain.cpp
unsigned-integer-overflow:chain.h
unsigned-integer-overflow:coins.cpp
unsigned-integer-overflow:compressor.cpp
unsigned-integer-overflow:core_write.cpp
@ -63,8 +61,6 @@ unsigned-integer-overflow:validation.cpp
implicit-integer-sign-change:addrman.h
implicit-integer-sign-change:bech32.cpp
implicit-integer-sign-change:common/bloom.cpp
implicit-integer-sign-change:chain.cpp
implicit-integer-sign-change:chain.h
implicit-integer-sign-change:coins.h
implicit-integer-sign-change:compat/stdin.cpp
implicit-integer-sign-change:compressor.h
@ -79,10 +75,8 @@ implicit-integer-sign-change:serialize.h
implicit-integer-sign-change:test/streams_tests.cpp
implicit-integer-sign-change:txmempool.cpp
implicit-integer-sign-change:zmq/zmqpublishnotifier.cpp
implicit-signed-integer-truncation,implicit-integer-sign-change:chain.h
implicit-signed-integer-truncation:addrman.cpp
implicit-signed-integer-truncation:addrman.h
implicit-signed-integer-truncation:chain.h
implicit-signed-integer-truncation:crypto/
implicit-unsigned-integer-truncation:crypto/
shift-base:arith_uint256.cpp