From 94eb1dd1732414167965d10af5b520db4ac339a8 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 20 Aug 2022 02:20:44 +0200 Subject: [PATCH] Util: Fix function source check, to prevent infinite recursion --- src/ruc/meta/assert.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ruc/meta/assert.h b/src/ruc/meta/assert.h index ce5c380..23a0209 100644 --- a/src/ruc/meta/assert.h +++ b/src/ruc/meta/assert.h @@ -71,8 +71,8 @@ inline void __assertion_failed(const char* assertion, const char* file, uint32_t fprintf(stderr, ": "); // Cant use the formatting library to print asserts caused by the formatting library std::string_view functionString = function; - if (functionString.find("ruc::format::") != std::string_view::npos - && functionString.find("ruc::GenericLexer::") != std::string_view::npos) { + if (functionString.find("ruc::format::") == std::string_view::npos + && functionString.find("ruc::GenericLexer::") == std::string_view::npos) { std::string message; formatTo(message, parameters...); fprintf(stderr, "%s", message.c_str());