From 04f5f42bb58f41c38c23ff7ab4a49c94a00c55f5 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 26 Jul 2022 23:47:47 +0200 Subject: [PATCH] Util: Add extra safety check for custom asserts --- src/util/meta/assert.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/meta/assert.h b/src/util/meta/assert.h index 2b305a4..c6e58ec 100644 --- a/src/util/meta/assert.h +++ b/src/util/meta/assert.h @@ -65,7 +65,9 @@ inline void __assertion_failed(const char* assertion, const char* file, uint32_t if constexpr (sizeof...(Parameters) > 0) { fprintf(stderr, ": "); // Cant use the formatting library to print asserts caused by the formatting library - if (!std::string_view(function).starts_with("Util::Format::")) { + std::string_view functionString = function; + if (!functionString.starts_with("Util::Format::") + && !functionString.starts_with("Util::GenericLexer::")) { std::string message; formatTo(message, parameters...); fprintf(stderr, "%s", message.c_str());