mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 01:33:20 +02:00
Introduce g_fuzzing global for fuzzing checks
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
bool g_fuzzing = false;
|
||||
|
||||
std::string StrFormatInternalBug(std::string_view msg, std::string_view file, int line, std::string_view func)
|
||||
{
|
||||
return strprintf("Internal bug detected: %s\n%s:%d (%s)\n"
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
extern bool g_fuzzing;
|
||||
|
||||
std::string StrFormatInternalBug(std::string_view msg, std::string_view file, int line, std::string_view func);
|
||||
|
||||
class NonFatalCheckError : public std::runtime_error
|
||||
@@ -42,7 +44,7 @@ void assertion_fail(std::string_view file, int line, std::string_view func, std:
|
||||
template <bool IS_ASSERT, typename T>
|
||||
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)
|
||||
{
|
||||
if (IS_ASSERT || std::is_constant_evaluated()
|
||||
if (IS_ASSERT || std::is_constant_evaluated() || g_fuzzing
|
||||
#ifdef ABORT_ON_FAILED_ASSUME
|
||||
|| true
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user