diff options
author | Hendiadyoin1 <leon2002.la@gmail.com> | 2021-10-24 23:29:42 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-16 00:49:48 +0000 |
commit | 6cb42d8a409b578138b17542bba4957bf8dc6ad7 (patch) | |
tree | d1083c414281cb9fe01c181a21fd0293a72cc006 /AK | |
parent | a164e6ecbbea4ee787d43cf083f4df352d758129 (diff) | |
download | serenity-6cb42d8a409b578138b17542bba4957bf8dc6ad7.zip |
AK: Verify that we are not overreaching in StringView's substring_view()
Diffstat (limited to 'AK')
-rw-r--r-- | AK/StringView.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/StringView.h b/AK/StringView.h index c8874333ad..7906ccf6f4 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -110,6 +110,8 @@ public: [[nodiscard]] constexpr StringView substring_view(size_t start) const { + if (!is_constant_evaluated()) + VERIFY(start <= length()); return substring_view(start, length() - start); } |