1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

IndexRange protection fix

This commit is contained in:
Brian Fiete 2021-10-24 09:00:24 -07:00
parent 1fd19c7672
commit 14794e5574
3 changed files with 11 additions and 11 deletions

View file

@ -177,7 +177,7 @@ namespace System
get
{
T* start;
switch (range.mStart)
switch (range.[Friend]mStart)
{
case .FromFront(let offset):
Debug.Assert((uint)offset <= (uint)mLength);
@ -187,9 +187,9 @@ namespace System
start = mPtr + mLength - 1 - offset;
}
T* end;
if (range.mIsClosed)
if (range.[Friend]mIsClosed)
{
switch (range.mEnd)
switch (range.[Friend]mEnd)
{
case .FromFront(let offset):
Debug.Assert((uint)offset < (uint)mLength);
@ -201,7 +201,7 @@ namespace System
}
else
{
switch (range.mEnd)
switch (range.[Friend]mEnd)
{
case .FromFront(let offset):
Debug.Assert((uint)offset <= (uint)mLength);