mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
IndexRange protection fix
This commit is contained in:
parent
1fd19c7672
commit
14794e5574
3 changed files with 11 additions and 11 deletions
|
@ -217,9 +217,9 @@ namespace System
|
|||
|
||||
struct IndexRange : RangeExpression
|
||||
{
|
||||
public Index mStart;
|
||||
public Index mEnd;
|
||||
public bool mIsClosed;
|
||||
protected Index mStart;
|
||||
protected Index mEnd;
|
||||
protected bool mIsClosed;
|
||||
|
||||
public this()
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3021,7 +3021,7 @@ namespace System
|
|||
get
|
||||
{
|
||||
char8* start;
|
||||
switch (range.mStart)
|
||||
switch (range.[Friend]mStart)
|
||||
{
|
||||
case .FromFront(let offset):
|
||||
Debug.Assert((uint)offset <= (uint)mLength);
|
||||
|
@ -3031,9 +3031,9 @@ namespace System
|
|||
start = mPtr + mLength - 1 - offset;
|
||||
}
|
||||
char8* 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);
|
||||
|
@ -3045,7 +3045,7 @@ namespace System
|
|||
}
|
||||
else
|
||||
{
|
||||
switch (range.mEnd)
|
||||
switch (range.[Friend]mEnd)
|
||||
{
|
||||
case .FromFront(let offset):
|
||||
Debug.Assert((uint)offset <= (uint)mLength);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue