summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorKevin Meyer <kevinmeyer@me.com>2020-06-13 00:04:17 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-15 22:32:18 +0200
commite0f4fdc9b4b7d1319d8ba6d4ae07c651ec85e091 (patch)
treef0489940b954a927c0989cf4859714fb0fa319d0 /AK
parent49cd03be9559c2c5c92ca35a7268639ee17a1257 (diff)
downloadserenity-e0f4fdc9b4b7d1319d8ba6d4ae07c651ec85e091.zip
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.
Diffstat (limited to 'AK')
-rw-r--r--AK/Utf32View.h1
1 files changed, 1 insertions, 0 deletions
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; }