Merge bitcoin/bitcoin#24196: Fix integer sanitizer suppressions in validation.cpp

fac62056b5 Fix integer sanitizer suppressions in validation.cpp (MarcoFalke)

Pull request description:

  It doesn't seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.

  Fix it with a refactor and remove the suppression.

ACKs for top commit:
  hebasto:
    ACK fac62056b5, I have reviewed the code and it looks OK, I agree it can be merged.
  prayank23:
    Code Review ACK fac62056b5

Tree-SHA512: efc5b9887cb2e207033b264ebf425bae5ff013e909701c049aea5d79a21f10495826e962d171b3d412717cbf0a4723e5124133b5401b35a73915212e85e91020
pull/826/head
MarcoFalke 3 years ago
commit 8ac79973f8
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

@ -1787,8 +1787,9 @@ DisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockI
error("DisconnectBlock(): transaction and undo data inconsistent"); error("DisconnectBlock(): transaction and undo data inconsistent");
return DISCONNECT_FAILED; return DISCONNECT_FAILED;
} }
for (unsigned int j = tx.vin.size(); j-- > 0;) { for (unsigned int j = tx.vin.size(); j > 0;) {
const COutPoint &out = tx.vin[j].prevout; --j;
const COutPoint& out = tx.vin[j].prevout;
int res = ApplyTxInUndo(std::move(txundo.vprevout[j]), view, out); int res = ApplyTxInUndo(std::move(txundo.vprevout[j]), view, out);
if (res == DISCONNECT_FAILED) return DISCONNECT_FAILED; if (res == DISCONNECT_FAILED) return DISCONNECT_FAILED;
fClean = fClean && res != DISCONNECT_UNCLEAN; fClean = fClean && res != DISCONNECT_UNCLEAN;

@ -57,7 +57,6 @@ unsigned-integer-overflow:pubkey.h
unsigned-integer-overflow:script/interpreter.cpp unsigned-integer-overflow:script/interpreter.cpp
unsigned-integer-overflow:txmempool.cpp unsigned-integer-overflow:txmempool.cpp
unsigned-integer-overflow:util/strencodings.cpp unsigned-integer-overflow:util/strencodings.cpp
unsigned-integer-overflow:validation.cpp
implicit-integer-sign-change:addrman.h implicit-integer-sign-change:addrman.h
implicit-integer-sign-change:bech32.cpp implicit-integer-sign-change:bech32.cpp
implicit-integer-sign-change:compat/stdin.cpp implicit-integer-sign-change:compat/stdin.cpp

Loading…
Cancel
Save