Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mscorlib/src/System/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ internal T get_Item<T>(int index) {
//! or you may introduce a security hole!
T[] _this = JitHelpers.UnsafeCast<T[]>(this);
if ((uint)index >= (uint)_this.Length) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}

return _this[index];
Expand All @@ -2726,7 +2726,7 @@ internal void set_Item<T>(int index, T value) {
//! or you may introduce a security hole!
T[] _this = JitHelpers.UnsafeCast<T[]>(this);
if ((uint)index >= (uint)_this.Length) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}

_this[index] = value;
Expand Down
6 changes: 3 additions & 3 deletions src/mscorlib/src/System/Collections/Generic/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ public T this[int index] {
get {
// Following trick can reduce the range check by one
if ((uint) index >= (uint)_size) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}
Contract.EndContractBlock();
return _items[index];
}

set {
if ((uint) index >= (uint)_size) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}
Contract.EndContractBlock();
_items[index] = value;
Expand Down Expand Up @@ -870,7 +870,7 @@ public int RemoveAll(Predicate<T> match) {
//
public void RemoveAt(int index) {
if ((uint)index >= (uint)_size) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}
Contract.EndContractBlock();
_size--;
Expand Down
4 changes: 2 additions & 2 deletions src/mscorlib/src/System/Collections/ObjectModel/Collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public T this[int index] {
}

if (index < 0 || index >= items.Count) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}

SetItem(index, value);
Expand Down Expand Up @@ -118,7 +118,7 @@ public void RemoveAt(int index) {
}

if (index < 0 || index >= items.Count) {
ThrowHelper.ThrowArgumentOutOfRangeException();
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}

RemoveItem(index);
Expand Down
Loading