From e0f4fdc9b4b7d1319d8ba6d4ae07c651ec85e091 Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Sat, 13 Jun 2020 00:04:17 +0200 Subject: [PATCH] AK: Assert non-empty Utf32View, when initialized with non-zero length This was useful in debugging a nullptr dereference, which was happening through later, but was caused by this inconsistent initialization. --- AK/Utf32View.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/Utf32View.h b/AK/Utf32View.h index 89c0eefcea..25f4c4a828 100644 --- a/AK/Utf32View.h +++ b/AK/Utf32View.h @@ -39,6 +39,7 @@ public: : m_codepoints(codepoints) , m_length(length) { + ASSERT(codepoints || length == 0); } const u32* codepoints() const { return m_codepoints; }