diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-09-06 10:44:42 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-09-06 17:24:27 -0400 |
| commit | dfb7067d77eaa7191295d8d223846edbe0f654a9 (patch) | |
| tree | 04dbbcda7e15c43e54cd88bcefba56ab6b3935b9 /src/dynamic-array.hpp | |
| parent | f3f2502d40bc4405be891de97ea7c081c760fd9b (diff) | |
DynArray [] operator assert on values > 0xF000000000000000
Diffstat (limited to 'src/dynamic-array.hpp')
| -rw-r--r-- | src/dynamic-array.hpp | 1 |
1 files changed, 1 insertions, 0 deletions
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 <typename T> inline DynArray<T>::~DynArray() { template <typename T> inline T &DynArray<T>::operator[](std::size_t index) { assert(index < this->elementCount && "Invalid DynArray<T>[] index - out of bounds"); assert(index < this->reservedCount && "Invalid DynArray<T>[] index - out of reserved bounds"); + assert(index < 0xF000000000000000 && "Invalid DynArray<T>[] index - unlikely value"); return *reinterpret_cast<T *>((this->ptr + (sizeof(T) * index))); } |
