mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Verify that we are not overreaching in StringView's substring_view()
This commit is contained in:
parent
a164e6ecbb
commit
6cb42d8a40
Notes:
sideshowbarker
2024-07-18 01:05:28 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/6cb42d8a409 Pull-request: https://github.com/SerenityOS/serenity/pull/10629 Reviewed-by: https://github.com/IdanHo
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue