Skip to content

Commit 8bc3964

Browse files
committed
Isolating the ref readonly indexer change only to CoreCLR for now.
Reverting the change to Enumerator Current for now Fix file formatting Enable Alpine CI (dotnet#15502) * Enable Alpine CI This enables Alpine CI leg on every PR using the pipelines. compare type size instead of var_types get rid of TYP_CHAR Adding support for Acosh, Asinh, Atanh, and Cbrt to Math and MathF Updating the PAL layer to support acosh, asinh, atanh, and cbrt Adding some PAL tests for acosh, asinh, atanh, and cbrt Adding valuenum support for acosh, asinh, atanh, and cbrt Lsra Documentation Update LinearScan section of ryujit-overview.md, and add lsra-detail.md Refactor Unsafe.cs to get it more in sync with CoreRT. (dotnet#15510) * Refactor Unsafe.cs to get it more in sync with CoreRT. * Format the document. * Unifying the copies of Unsafe using ifdefs * Change exception thrown to PlatformNotSupportedException * Addressing PR feedback and moving Unsafe to shared. * Addressing PR feedback * Addressing PR review - adding intrinsic attribute Update CoreClr, CoreFx to preview1-26014-01, preview1-26013-12, respectively (dotnet#15513) Revert "Add optional integer offset to OwnedMemory Pin (dotnet#15410)" This reverts commit 8931cfa. Get rid of old -altjitcrossgen argument now that CI has been updated Merge pull request dotnet/corert#5109 from dotnet/nmirror (dotnet#15518) Merge nmirror to master Signed-off-by: dotnet-bot <[email protected]> Revert " Revert "[Local GC] Move knowledge of overlapped I/O objects to the EE through four callbacks (dotnet#14982)"" Fix typo `_TARGET_ARM` to `_TARGET_ARM_`. This happens mostly in comments except lsra.cpp. Update CoreClr, CoreFx, PgoData to preview1-26014-04, preview1-26014-03, master-20171214-0043, respectively (dotnet#15520)
1 parent 7abd39d commit 8bc3964

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/jit/importer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3794,7 +3794,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis,
37943794
// Prepare result
37953795
var_types resultType = JITtype2varType(sig->retType);
37963796
assert(resultType == result->TypeGet());
3797-
retNode = gtNewOperNode(GT_COMMA, resultType, boundsCheck, result);
3797+
retNode = gtNewOperNode(GT_COMMA, resultType, boundsCheck, result);
37983798

37993799
break;
38003800
}

src/mscorlib/shared/System/ReadOnlySpan.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public ref readonly T this[int index]
175175
}
176176
}
177177
#else
178-
public T this[int index]
178+
public ref readonly T this[int index]
179179
{
180180
[Intrinsic]
181181
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -364,7 +364,20 @@ public bool MoveNext()
364364
public ref readonly T Current
365365
{
366366
[MethodImpl(MethodImplOptions.AggressiveInlining)]
367-
get => ref _span[_index];
367+
get
368+
{
369+
// TODO https://github.com/dotnet/coreclr/pull/14727:
370+
// Change this to simply be:
371+
// get => ref readonly _span[_index];
372+
// once ReadOnlySpan<T>'s indexer returns ref readonly.
373+
374+
if ((uint)_index >= (uint)_span.Length)
375+
{
376+
ThrowHelper.ThrowIndexOutOfRangeException();
377+
}
378+
379+
return ref Unsafe.Add(ref _span.DangerousGetPinnableReference(), _index);
380+
}
368381
}
369382
}
370383
}

0 commit comments

Comments
 (0)