From a65f178ce841a5bd82ba777b27715b3ff06be8f2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Feb 2021 11:30:24 +0100 Subject: [PATCH] AK: Do bounds checking (assertions) in Span::operator[] --- AK/Span.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AK/Span.h b/AK/Span.h index 9890b6c144..7f4eda89b7 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2020-2021, the SerenityOS developers. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -209,11 +209,11 @@ public: ALWAYS_INLINE constexpr T& operator[](size_t index) const { - return this->m_values[index]; + return at(index); } ALWAYS_INLINE constexpr T& operator[](size_t index) { - return this->m_values[index]; + return at(index); } ALWAYS_INLINE constexpr Span& operator=(const Span& other)