fuzz coverage

Coverage Report

Created: 2025-10-29 15:27

/Users/eugenesiegel/btc/bitcoin/src/util/check.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2019-2022 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_UTIL_CHECK_H
6
#define BITCOIN_UTIL_CHECK_H
7
8
#include <attributes.h>
9
10
#include <atomic>
11
#include <cassert> // IWYU pragma: export
12
#include <stdexcept>
13
#include <string>
14
#include <string_view>
15
#include <utility>
16
17
constexpr bool G_FUZZING_BUILD{
18
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
19
    true
20
#else
21
    false
22
#endif
23
};
24
constexpr bool G_ABORT_ON_FAILED_ASSUME{
25
#ifdef ABORT_ON_FAILED_ASSUME
26
    true
27
#else
28
    false
29
#endif
30
};
31
32
extern std::atomic<bool> g_enable_dynamic_fuzz_determinism;
33
34
inline bool EnableFuzzDeterminism()
35
17.3M
{
36
17.3M
    if constexpr (G_FUZZING_BUILD) {
37
17.3M
        return true;
38
    } else if constexpr (!G_ABORT_ON_FAILED_ASSUME) {
39
        // Running fuzz tests is always disabled if Assume() doesn't abort
40
        // (ie, non-fuzz non-debug builds), as otherwise tests which
41
        // should fail due to a failing Assume may still pass. As such,
42
        // we also statically disable fuzz determinism in that case.
43
        return false;
44
    } else {
45
        return g_enable_dynamic_fuzz_determinism;
46
    }
47
17.3M
}
48
49
std::string StrFormatInternalBug(std::string_view msg, std::string_view file, int line, std::string_view func);
50
51
class NonFatalCheckError : public std::runtime_error
52
{
53
public:
54
    NonFatalCheckError(std::string_view msg, std::string_view file, int line, std::string_view func);
55
};
56
57
/** Helper for CHECK_NONFATAL() */
58
template <typename T>
59
T&& inline_check_non_fatal(LIFETIMEBOUND T&& val, const char* file, int line, const char* func, const char* assertion)
60
5.33M
{
61
5.33M
    if (!val) {
62
0
        throw NonFatalCheckError{assertion, file, line, func};
63
0
    }
64
5.33M
    return std::forward<T>(val);
65
5.33M
}
_Z22inline_check_non_fatalIbEOT_S1_PKciS3_S3_
Line
Count
Source
60
5.33M
{
61
5.33M
    if (!val) {
62
0
        throw NonFatalCheckError{assertion, file, line, func};
63
0
    }
64
5.33M
    return std::forward<T>(val);
65
5.33M
}
Unexecuted instantiation: _Z22inline_check_non_fatalIRKbEOT_S3_PKciS5_S5_
Unexecuted instantiation: _Z22inline_check_non_fatalIRbEOT_S2_PKciS4_S4_
Unexecuted instantiation: _Z22inline_check_non_fatalIRPK14JSONRPCRequestEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalIRPK8UniValueEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalINSt3__18optionalI13arith_uint256EEEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalIRPN6wallet25DescriptorScriptPubKeyManEEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalINSt3__110unique_ptrI16CCoinsViewCursorNS0_14default_deleteIS2_EEEEEOT_S7_PKciS9_S9_
Unexecuted instantiation: _Z22inline_check_non_fatalIRPK11CBlockIndexEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalIPN4node12BlockManagerEEOT_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_check_non_fatalINSt3__110shared_ptrIK12CTransactionEEEOT_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_check_non_fatalIRP11CBlockIndexEOT_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_check_non_fatalINSt3__18optionalIN10interfaces8BlockRefEEEEOT_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_check_non_fatalIRNSt3__110unique_ptrI17ValidationSignalsNS0_14default_deleteIS2_EEEEEOT_S8_PKciSA_SA_
Unexecuted instantiation: _Z22inline_check_non_fatalIP11CBlockIndexEOT_S3_PKciS5_S5_
Unexecuted instantiation: _Z22inline_check_non_fatalIPK11CBlockIndexEOT_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_check_non_fatalIRKP11CBlockIndexEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalIRNSt3__110unique_ptrIN4node8WarningsENS0_14default_deleteIS3_EEEEEOT_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_check_non_fatalIRNSt3__18optionalIN6kernel11CCoinsStatsEEEEOT_S7_PKciS9_S9_
Unexecuted instantiation: _Z22inline_check_non_fatalIRKP17ValidationSignalsEOT_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_check_non_fatalIRKNSt3__110unique_ptrI17ValidationSignalsNS0_14default_deleteIS2_EEEEEOT_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_check_non_fatalIRNSt3__110unique_ptrIN10interfaces13BlockTemplateENS0_14default_deleteIS3_EEEEEOT_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_check_non_fatalIRKNSt3__110unique_ptrI10CSchedulerNS0_14default_deleteIS2_EEEEEOT_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_check_non_fatalIRNSt3__18functionIFbvEEEEOT_S6_PKciS8_S8_
66
67
#if defined(NDEBUG)
68
#error "Cannot compile without assertions!"
69
#endif
70
71
/** Helper for Assert() */
72
void assertion_fail(std::string_view file, int line, std::string_view func, std::string_view assertion);
73
74
/** Helper for Assert()/Assume() */
75
template <bool IS_ASSERT, typename T>
76
constexpr T&& inline_assertion_check(LIFETIMEBOUND T&& val, [[maybe_unused]] const char* file, [[maybe_unused]] int line, [[maybe_unused]] const char* func, [[maybe_unused]] const char* assertion)
77
203M
{
78
203M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
203M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
203M
    }
83
203M
    return std::forward<T>(val);
84
203M
}
_Z22inline_assertion_checkILb0EbEOT0_S1_PKciS3_S3_
Line
Count
Source
77
102M
{
78
102M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
102M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
102M
    }
83
102M
    return std::forward<T>(val);
84
102M
}
_Z22inline_assertion_checkILb0EiEOT0_S1_PKciS3_S3_
Line
Count
Source
77
39.9M
{
78
39.9M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
39.9M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
39.9M
    }
83
39.9M
    return std::forward<T>(val);
84
39.9M
}
_Z22inline_assertion_checkILb0ERKhEOT0_S3_PKciS5_S5_
Line
Count
Source
77
163k
{
78
163k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
163k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
163k
    }
83
163k
    return std::forward<T>(val);
84
163k
}
_Z22inline_assertion_checkILb1ERKNSt3__110unique_ptrI14LevelDBContextNS0_14default_deleteIS2_EEEEEOT0_S9_PKciSB_SB_
Line
Count
Source
77
6.25M
{
78
6.25M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
6.25M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
6.25M
    }
83
6.25M
    return std::forward<T>(val);
84
6.25M
}
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI10CoinsViewsNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_
Line
Count
Source
77
6.35M
{
78
6.35M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
6.35M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
6.35M
    }
83
6.35M
    return std::forward<T>(val);
84
6.35M
}
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI15CCoinsViewCacheNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_
Line
Count
Source
77
6.20M
{
78
6.20M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
6.20M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
6.20M
    }
83
6.20M
    return std::forward<T>(val);
84
6.20M
}
_Z22inline_assertion_checkILb1ERKNSt3__18optionalI13arith_uint256EEEOT0_S7_PKciS9_S9_
Line
Count
Source
77
7.34M
{
78
7.34M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
7.34M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
7.34M
    }
83
7.34M
    return std::forward<T>(val);
84
7.34M
}
_Z22inline_assertion_checkILb1ERKNSt3__18optionalI7uint256EEEOT0_S7_PKciS9_S9_
Line
Count
Source
77
76.3k
{
78
76.3k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
76.3k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
76.3k
    }
83
76.3k
    return std::forward<T>(val);
84
76.3k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERmEOT0_S2_PKciS4_S4_
Unexecuted instantiation: _Z22inline_assertion_checkILb1E10MinisketchEOT0_S2_PKciS4_S4_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalINS0_6vectorIyNS0_9allocatorIyEEEEEEEOT0_S8_PKciSA_SA_
_Z22inline_assertion_checkILb1EbEOT0_S1_PKciS3_S3_
Line
Count
Source
77
11.1M
{
78
11.1M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
11.1M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
11.1M
    }
83
11.1M
    return std::forward<T>(val);
84
11.1M
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERbEOT0_S2_PKciS4_S4_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERPK13MappingResultEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EPK15CTxMemPoolEntryEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ElEOT0_S1_PKciS3_S3_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKbEOT0_S3_PKciS5_S5_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__18optionalIxEEEOT0_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__18optionalI8CFeeRateEEEOT0_S7_PKciS9_S9_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__18optionalINS0_6vectorI22transaction_identifierILb1EENS0_9allocatorIS4_EEEEEEEOT0_SC_PKciSE_SE_
_Z22inline_assertion_checkILb1ERPK11CBlockIndexEOT0_S5_PKciS7_S7_
Line
Count
Source
77
1.18M
{
78
1.18M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
1.18M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
1.18M
    }
83
1.18M
    return std::forward<T>(val);
84
1.18M
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalIN6kernel11CCoinsStatsEEEEOT0_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalI14AssumeutxoDataEEEOT0_S5_PKciS7_S7_
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI17ChainstateManagerNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERKmEOT0_S3_PKciS5_S5_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalIiEEEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EN4util6ResultINSt3__117reference_wrapperIN6wallet25DescriptorScriptPubKeyManEEEEEEOT0_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalI10OutputTypeEEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EN4util6ResultINSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEEEEEOT0_SG_PKciSI_SI_
_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_PKciSD_SD_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__18optionalIN2fs4pathEEEEOT0_S8_PKciSA_SA_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__18optionalI19CMutableTransactionEEEOT0_S6_PKciS8_S8_
_Z22inline_assertion_checkILb0ERKbEOT0_S3_PKciS5_S5_
Line
Count
Source
77
719k
{
78
719k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
719k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
719k
    }
83
719k
    return std::forward<T>(val);
84
719k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERP10CSchedulerEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERP11ArgsManagerEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EPKN6wallet9CWalletTxEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__110unique_ptrIN6wallet17SQliteExecHandlerENS0_14default_deleteIS3_EEEEEOT0_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EyEOT0_S1_PKciS3_S3_
_Z22inline_assertion_checkILb1ERKPK7uint256EOT0_S6_PKciS8_S8_
Line
Count
Source
77
518k
{
78
518k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
518k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
518k
    }
83
518k
    return std::forward<T>(val);
84
518k
}
_Z22inline_assertion_checkILb0ERbEOT0_S2_PKciS4_S4_
Line
Count
Source
77
493k
{
78
493k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
493k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
493k
    }
83
493k
    return std::forward<T>(val);
84
493k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERPN6wallet14LegacyDataSPKMEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__110unique_ptrI17ChainstateManagerNS0_14default_deleteIS2_EEEEEOT0_S9_PKciSB_SB_
_Z22inline_assertion_checkILb1EP10CTxMemPoolEOT0_S3_PKciS5_S5_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1ERNSt3__16atomicIbEEEOT0_S5_PKciS7_S7_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1ERNSt3__18functionIFbvEEEEOT0_S6_PKciS8_S8_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrIN4node8WarningsENS0_14default_deleteIS3_EEEEEOT0_S9_PKciSB_SB_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1ERPN4util15SignalInterruptEEOT0_S5_PKciS7_S7_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1ERKN4util6ResultIvEEEOT0_S6_PKciS8_S8_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
_Z22inline_assertion_checkILb1EPK11CBlockIndexEOT0_S4_PKciS6_S6_
Line
Count
Source
77
14.4k
{
78
14.4k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
14.4k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
14.4k
    }
83
14.4k
    return std::forward<T>(val);
84
14.4k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1EP17evhttp_connectionEOT0_S3_PKciS5_S5_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERP14evhttp_requestEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERPK17evhttp_connectionEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKPK6CBlockEOT0_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKPK10CBlockUndoEOT0_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalI7uint256EEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__18optionalIN4util15SignalInterruptEEEEOT0_S7_PKciS9_S9_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EN4util6ResultIvEEEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI17ValidationSignalsNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__110unique_ptrIN4node19KernelNotificationsENS0_14default_deleteIS3_EEEEEOT0_S9_PKciSB_SB_
_Z22inline_assertion_checkILb1EP11CBlockIndexEOT0_S3_PKciS5_S5_
Line
Count
Source
77
1.37M
{
78
1.37M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
1.37M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
1.37M
    }
83
1.37M
    return std::forward<T>(val);
84
1.37M
}
_Z22inline_assertion_checkILb1ERP11CBlockIndexEOT0_S4_PKciS6_S6_
Line
Count
Source
77
24.9k
{
78
24.9k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
24.9k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
24.9k
    }
83
24.9k
    return std::forward<T>(val);
84
24.9k
}
net_processing.cpp:_Z22inline_assertion_checkILb1EPN12_GLOBAL__N_110CNodeStateEEOT0_S4_PKciS6_S6_
Line
Count
Source
77
104k
{
78
104k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
104k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
104k
    }
83
104k
    return std::forward<T>(val);
84
104k
}
Unexecuted instantiation: net_processing.cpp:_Z22inline_assertion_checkILb1ENSt3__110shared_ptrIN12_GLOBAL__N_14PeerEEEEOT0_S6_PKciS8_S8_
_Z22inline_assertion_checkILb0EP11CBlockIndexEOT0_S3_PKciS5_S5_
Line
Count
Source
77
31.4k
{
78
31.4k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
31.4k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
31.4k
    }
83
31.4k
    return std::forward<T>(val);
84
31.4k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKNSt3__18optionalI14AssumeutxoDataEEEOT0_S7_PKciS9_S9_
_Z22inline_assertion_checkILb1ERNSt3__18optionalIN4node15BlockfileCursorEEEEOT0_S7_PKciS9_S9_
Line
Count
Source
77
21.7k
{
78
21.7k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
21.7k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
21.7k
    }
83
21.7k
    return std::forward<T>(val);
84
21.7k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERPN4node11NodeContextEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1EPN4node11NodeContextEEOT0_S4_PKciS6_S6_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERPN10interfaces12WalletLoaderEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERKPK10CTxMemPoolEOT0_S6_PKciS8_S8_
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERKNSt3__18optionalI7uint256EEEOT0_S7_PKciS9_S9_
Unexecuted instantiation: _Z22inline_assertion_checkILb0ENSt3__18optionalI7uint256EEEOT0_S5_PKciS7_S7_
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERPKN7TxGraph3RefEEOT0_S6_PKciS8_S8_
Unexecuted instantiation: txgraph.cpp:_Z22inline_assertion_checkILb0ERPN12_GLOBAL__N_17ClusterEEOT0_S5_PKciS7_S7_
_Z22inline_assertion_checkILb0ERN4util6ResultINSt3__13setIN5boost11multi_index6detail21hashed_index_iteratorINS6_17hashed_index_nodeINS8_INS6_18ordered_index_nodeINS6_19null_augment_policyENS9_ISA_NS9_ISA_NS6_15index_node_baseI15CTxMemPoolEntryNS2_9allocatorISC_EEEEEEEEEEEEEENS6_12bucket_arrayISE_EENS6_17hashed_unique_tagENS6_32hashed_index_global_iterator_tagEEE21CompareIteratorByHashNSD_ISP_EEEEEEEOT0_SW_PKciSY_SY_
Line
Count
Source
77
16.6M
{
78
16.6M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
16.6M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
16.6M
    }
83
16.6M
    return std::forward<T>(val);
84
16.6M
}
_Z22inline_assertion_checkILb0EN4util6ResultINSt3__13setIN5boost11multi_index6detail21hashed_index_iteratorINS6_17hashed_index_nodeINS8_INS6_18ordered_index_nodeINS6_19null_augment_policyENS9_ISA_NS9_ISA_NS6_15index_node_baseI15CTxMemPoolEntryNS2_9allocatorISC_EEEEEEEEEEEEEENS6_12bucket_arrayISE_EENS6_17hashed_unique_tagENS6_32hashed_index_global_iterator_tagEEE21CompareIteratorByHashNSD_ISP_EEEEEEEOT0_SV_PKciSX_SX_
Line
Count
Source
77
493k
{
78
493k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
493k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
493k
    }
83
493k
    return std::forward<T>(val);
84
493k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb0ERNSt3__110unique_ptrIN10CTxMemPool9ChangeSetENS0_14default_deleteIS3_EEEEEOT0_S9_PKciSB_SB_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERPK7uint256EOT0_S5_PKciS7_S7_
_Z22inline_assertion_checkILb1ERKNSt3__18optionalIiEEEOT0_S6_PKciS8_S8_
Line
Count
Source
77
2.06M
{
78
2.06M
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
2.06M
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
2.06M
    }
83
2.06M
    return std::forward<T>(val);
84
2.06M
}
_Z22inline_assertion_checkILb0ERKP11CBlockIndexEOT0_S5_PKciS7_S7_
Line
Count
Source
77
146k
{
78
146k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
146k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
146k
    }
83
146k
    return std::forward<T>(val);
84
146k
}
Unexecuted instantiation: _Z22inline_assertion_checkILb1ERNSt3__110unique_ptrI10ChainstateNS0_14default_deleteIS2_EEEEEOT0_S8_PKciSA_SA_
Unexecuted instantiation: _Z22inline_assertion_checkILb1ENSt3__18optionalIN2fs4pathEEEEOT0_S6_PKciS8_S8_
_Z22inline_assertion_checkILb1ERNSt3__110unique_ptrIN4util19TaskRunnerInterfaceENS0_14default_deleteIS3_EEEEEOT0_S9_PKciSB_SB_
Line
Count
Source
77
51.2k
{
78
51.2k
    if (IS_ASSERT || 
std::is_constant_evaluated()0
||
G_FUZZING_BUILD0
||
G_ABORT_ON_FAILED_ASSUME0
) {
79
51.2k
        if (!val) {
80
0
            assertion_fail(file, line, func, assertion);
81
0
        }
82
51.2k
    }
83
51.2k
    return std::forward<T>(val);
84
51.2k
}
85
86
// All macros may use __func__ inside a lambda, so put them under nolint.
87
// NOLINTBEGIN(bugprone-lambda-function-name)
88
89
0
#define STR_INTERNAL_BUG(msg) StrFormatInternalBug((msg), __FILE__, __LINE__, __func__)
90
91
/**
92
 * Identity function. Throw a NonFatalCheckError when the condition evaluates to false
93
 *
94
 * This should only be used
95
 * - where the condition is assumed to be true, not for error handling or validating user input
96
 * - where a failure to fulfill the condition is recoverable and does not abort the program
97
 *
98
 * For example in RPC code, where it is undesirable to crash the whole program, this can be generally used to replace
99
 * asserts or recoverable logic errors. A NonFatalCheckError in RPC code is caught and passed as a string to the RPC
100
 * caller, which can then report the issue to the developers.
101
 */
102
#define CHECK_NONFATAL(condition) \
103
5.33M
    inline_check_non_fatal(
condition0
, __FILE__, __LINE__, __func__, #condition)
Unexecuted instantiation: blockchain.cpp:_ZZL12GetUTXOStatsP10CCoinsViewRN4node12BlockManagerEN6kernel17CoinStatsHashTypeERKNSt3__18functionIFvvEEEPK11CBlockIndexbENK3$_0clEv
Unexecuted instantiation: blockchain.cpp:_ZZZL10scanblocksvENK3$_0clERK10RPCHelpManRK14JSONRPCRequestENKUlvE0_clEv
104
105
/** Identity function. Abort if the value compares equal to zero */
106
43.3M
#define Assert(val) inline_assertion_check<true>(
val21.7k
, __FILE__, __LINE__, __func__, #val)
Unexecuted instantiation: txmempool.cpp:_ZZ31CheckMempoolEphemeralInvariantsRK10CTxMemPoolENK3$_0clERK5CTxIn
blockstorage.cpp:_ZZN4node12BlockManager14WriteBlockUndoERK10CBlockUndoR20BlockValidationStateR11CBlockIndexENK3$_0clEv
Line
Count
Source
106
21.7k
#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
107
108
/**
109
 * Assume is the identity function.
110
 *
111
 * - Should be used to run non-fatal checks. In debug builds it behaves like
112
 *   Assert()/assert() to notify developers and testers about non-fatal errors.
113
 *   In production it doesn't warn or log anything.
114
 * - For fatal errors, use Assert().
115
 * - For non-fatal errors in interactive sessions (e.g. RPC or command line
116
 *   interfaces), CHECK_NONFATAL() might be more appropriate.
117
 */
118
160M
#define Assume(val) inline_assertion_check<false>(
val127M
, __FILE__, __LINE__, __func__, #val)
Unexecuted instantiation: scriptpubkeyman.cpp:_ZZNK6wallet25DescriptorScriptPubKeyMan6GetKeyERK6CKeyIDENK3$_0clERKNSt3__16vectorIh16secure_allocatorIhEEE
Unexecuted instantiation: wallet.cpp:_ZZNK6wallet7CWallet19GetScriptPubKeyMansERK7CScriptENK3$_0clEPNS_15ScriptPubKeyManE
net_processing.cpp:_ZZN12_GLOBAL__N_115PeerManagerImpl14ProcessMessageER5CNodeRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEER10DataStreamNS3_6chrono8durationIxNS3_5ratioILl1ELl1000000EEEEERKNS3_6atomicIbEEENK3$_1clEv
Line
Count
Source
118
193k
#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
Unexecuted instantiation: mini_miner.cpp:_ZZNK4node9MiniMiner11SanityCheckEvENK3$_0clINSt3__114__map_iteratorINS3_15__tree_iteratorINS3_12__value_typeI22transaction_identifierILb0EENS_21MiniMinerMempoolEntryEEEPNS3_11__tree_nodeISA_PvEElEEEEEEDaRKT_
Unexecuted instantiation: mini_miner.cpp:_ZZNK4node9MiniMiner11SanityCheckEvENK3$_1clI22transaction_identifierILb0EEEEDaRKT_
ephemeral_policy.cpp:_ZZ20CheckEphemeralSpendsRKNSt3__16vectorINS_10shared_ptrIK12CTransactionEENS_9allocatorIS4_EEEE8CFeeRateRK10CTxMemPoolR17TxValidationStateR22transaction_identifierILb1EEENK3$_0clIS4_EEDaRKT_
Line
Count
Source
118
638k
#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
119
120
/**
121
 * NONFATAL_UNREACHABLE() is a macro that is used to mark unreachable code. It throws a NonFatalCheckError.
122
 */
123
#define NONFATAL_UNREACHABLE()                                        \
124
0
    throw NonFatalCheckError(                                         \
125
0
        "Unreachable code reached (non-fatal)", __FILE__, __LINE__, __func__)
126
127
// NOLINTEND(bugprone-lambda-function-name)
128
129
#if defined(__has_feature)
130
#    if __has_feature(address_sanitizer)
131
#       include <sanitizer/asan_interface.h>
132
#    endif
133
#endif
134
135
#ifndef ASAN_POISON_MEMORY_REGION
136
40.3M
#   define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
137
68.3M
#   define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
138
#endif
139
140
#endif // BITCOIN_UTIL_CHECK_H