From dc6485cfcb08eebb97936e38dc5400fa19ed45ed Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 26 Feb 2021 18:32:00 -0700 Subject: [PATCH] LibRegex: VERIFY that string builder in print_header is not null. I don't know why g++ thinks this is the case with ENABLE_ALL_DEBUG_MACROS when building for serenity. Adding an assert to placate it seems reasonable --- Userland/Libraries/LibRegex/RegexDebug.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibRegex/RegexDebug.h b/Userland/Libraries/LibRegex/RegexDebug.h index 5b48fc8a2d..26deddd0ea 100644 --- a/Userland/Libraries/LibRegex/RegexDebug.h +++ b/Userland/Libraries/LibRegex/RegexDebug.h @@ -129,8 +129,10 @@ public: for (size_t i = 0; i < length; ++i) { builder.append('='); } + auto str = builder.to_string(); + VERIFY(!str.is_empty()); - fprintf(m_file, "%s\n", builder.to_string().characters()); + fprintf(m_file, "%s\n", str.characters()); fflush(m_file); builder.clear();