You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: (bug) Span<T>.get_Item intrinsic evaluates the index before the receiver #133963
The optimized importer expansion for Span<T>.get_Item and ReadOnlySpan<T>.get_Item can spill/evaluate the index before the receiver, violating IL evaluation order and producing wrong results when the receiver mutates state read by the index.
The intrinsic path pops receiver and index, then clones/spills the index first; since the receiver has already been popped, that spill is appended before the side-effecting receiver evaluation.
The array indexer path preserves the required receiver-before-index order, so it returns 20.
Activity
dotnet-policy-service commentedon Sep 15, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: Preserve receiver-before-index evaluation for Span indexers (#13…
EgorBo commentedon Sep 18, 2026
Affected SDK versions:
JIT: Preserve receiver-before-index evaluation for Span indexers (dot…