summaryrefslogtreecommitdiff
path: root/indra/llcommon/llalignedarray.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-02-05 02:52:56 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-02-05 02:59:10 +0200
commit855f53901a2265400797f33f3fb8b53ddc6cc07f (patch)
tree906816e2f3c11e98f62517f81cecf716fdacd2cd /indra/llcommon/llalignedarray.h
parent26e03f0c65c0b36705e468687553bbf54cca77be (diff)
SL-16799 Clean up use of hardcoded folder names
Diffstat (limited to 'indra/llcommon/llalignedarray.h')
-rw-r--r--indra/llcommon/llalignedarray.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h
index 5f52bc0b15..da9d98c16c 100644
--- a/indra/llcommon/llalignedarray.h
+++ b/indra/llcommon/llalignedarray.h
@@ -116,7 +116,7 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
template <class T, U32 alignment>
T& LLAlignedArray<T, alignment>::operator[](int idx)
{
- if(idx >= mElementCount)
+ if(idx >= mElementCount || idx < 0)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
@@ -126,7 +126,7 @@ T& LLAlignedArray<T, alignment>::operator[](int idx)
template <class T, U32 alignment>
const T& LLAlignedArray<T, alignment>::operator[](int idx) const
{
- if (idx >= mElementCount)
+ if (idx >= mElementCount || idx < 0)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}