diff options
author | swarmer <[email protected]> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:31 +0300 |
commit | 11a24635da4c4f39428b182c49a7bc35e47c9534 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system/yassert.cpp | |
parent | 317da38588b7898a99fd9168571408123350012b (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system/yassert.cpp')
-rw-r--r-- | util/system/yassert.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp index 60dbe4c04a1..0f586648b78 100644 --- a/util/system/yassert.cpp +++ b/util/system/yassert.cpp @@ -7,7 +7,7 @@ #include <util/datetime/base.h> #include <util/generic/singleton.h> -#include <util/generic/strbuf.h> +#include <util/generic/strbuf.h> #include <util/generic/string.h> #include <util/stream/output.h> #include <util/stream/str.h> @@ -34,9 +34,9 @@ namespace { struct TPanicLockHolder: public TAdaptiveLock { }; } -namespace NPrivate { - [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept; -} +namespace NPrivate { + [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept; +} void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, const char* expr, const char* format, ...) noexcept { try { @@ -51,18 +51,18 @@ void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, c vsprintf(errorMsg, format[0] == ' ' ? format + 1 : format, args); va_end(args); - constexpr int abiPlaceholder = 0; - ::NPrivate::InternalPanicImpl(line, function, expr, abiPlaceholder, abiPlaceholder, abiPlaceholder, file.As<TStringBuf>(), errorMsg.c_str(), errorMsg.size()); - } catch (...) { - // ¯\_(ツ)_/¯ - } - - abort(); -} - -namespace NPrivate { - [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try { - TStringBuf errorMsg{errorMessage, errorMessageSize}; + constexpr int abiPlaceholder = 0; + ::NPrivate::InternalPanicImpl(line, function, expr, abiPlaceholder, abiPlaceholder, abiPlaceholder, file.As<TStringBuf>(), errorMsg.c_str(), errorMsg.size()); + } catch (...) { + // ¯\_(ツ)_/¯ + } + + abort(); +} + +namespace NPrivate { + [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try { + TStringBuf errorMsg{errorMessage, errorMessageSize}; const TString now = TInstant::Now().ToStringLocal(); TString r; @@ -72,7 +72,7 @@ namespace NPrivate { } else { o << "FAIL (" << now << "): " << errorMsg << Endl; } - o << " " << file << ":" << line << Endl; + o << " " << file << ":" << line << Endl; if (expr) { o << " " << function << "(): requirement " << expr << " failed" << Endl; } else { @@ -87,8 +87,8 @@ namespace NPrivate { Cerr << "Failed to dump clang coverage" << Endl; } #endif - abort(); + abort(); } catch (...) { - abort(); + abort(); } } |