summaryrefslogtreecommitdiffstats
path: root/util/system/yassert.cpp
diff options
context:
space:
mode:
authornga <[email protected]>2022-02-10 16:48:09 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:48:09 +0300
commit1f553f46fb4f3c5eec631352cdd900a0709016af (patch)
treea231fba2c03b440becaea6c86a2702d0bfb0336e /util/system/yassert.cpp
parentc4de7efdedc25b49cbea74bd589eecb61b55b60a (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/yassert.cpp')
-rw-r--r--util/system/yassert.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp
index 0f586648b78..d356f113006 100644
--- a/util/system/yassert.cpp
+++ b/util/system/yassert.cpp
@@ -12,7 +12,7 @@
#include <util/stream/output.h>
#include <util/stream/str.h>
#include <util/string/printf.h>
-
+
#include <cstdlib>
#include <stdarg.h>
#include <stdio.h>
@@ -37,20 +37,20 @@ namespace {
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 {
// We care of panic of first failed thread only
// Otherwise stderr could contain multiple messages and stack traces shuffled
auto guard = Guard(*Singleton<TPanicLockHolder>());
-
+
TString errorMsg;
va_list args;
va_start(args, format);
- // format has " " prefix to mute GCC warning on empty format
- vsprintf(errorMsg, format[0] == ' ' ? format + 1 : format, args);
+ // format has " " prefix to mute GCC warning on empty format
+ 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 (...) {
@@ -69,19 +69,19 @@ namespace NPrivate {
TStringOutput o(r);
if (expr) {
o << "VERIFY failed (" << now << "): " << errorMsg << Endl;
- } else {
+ } else {
o << "FAIL (" << now << "): " << errorMsg << Endl;
- }
+ }
o << " " << file << ":" << line << Endl;
if (expr) {
- o << " " << function << "(): requirement " << expr << " failed" << Endl;
- } else {
- o << " " << function << "() failed" << Endl;
- }
+ o << " " << function << "(): requirement " << expr << " failed" << Endl;
+ } else {
+ o << " " << function << "() failed" << Endl;
+ }
Cerr << r << Flush;
-#ifndef WITH_VALGRIND
+#ifndef WITH_VALGRIND
PrintBackTrace();
-#endif
+#endif
#ifdef CLANG_COVERAGE
if (__llvm_profile_write_file()) {
Cerr << "Failed to dump clang coverage" << Endl;
@@ -91,4 +91,4 @@ namespace NPrivate {
} catch (...) {
abort();
}
-}
+}