From dfb7067d77eaa7191295d8d223846edbe0f654a9 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 6 Sep 2023 10:44:42 -0400 Subject: DynArray [] operator assert on values > 0xF000000000000000 --- src/dynamic-array.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/dynamic-array.hpp') diff --git a/src/dynamic-array.hpp b/src/dynamic-array.hpp index 1c99b4c..978e291 100644 --- a/src/dynamic-array.hpp +++ b/src/dynamic-array.hpp @@ -57,6 +57,7 @@ template inline DynArray::~DynArray() { template inline T &DynArray::operator[](std::size_t index) { assert(index < this->elementCount && "Invalid DynArray[] index - out of bounds"); assert(index < this->reservedCount && "Invalid DynArray[] index - out of reserved bounds"); + assert(index < 0xF000000000000000 && "Invalid DynArray[] index - unlikely value"); return *reinterpret_cast((this->ptr + (sizeof(T) * index))); } -- cgit v1.2.3