Repro: ```cs using System.Runtime.CompilerServices; sealed class S { ushort[] d = [0,0,1,65535,1,0,1,65535,65535]; int[] a = [0, 4]; int i; bool Next(out int p) { bool r; if (r = i < a.Length) p = a[i++]; else p = -1; return r; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] internal long Sum() { i = 0; long s = 0; int x, p; while (Next(out p)) { while ((x = d[p]) != 65535) { s += x; p++; } } return s; } static void Main() { if (new S().Sum() != 3) throw new InvalidOperationException(); } } ``` **Actual:** ``` InvalidOperationException is thrown ``` **Expected:** ``` no exception is thrown ``` Presumably reproduces on .NET 10.0 and main at least on win-x64
Activity
dotnet-policy-service commentedon Jul 3, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: fix widened IV init placed in unreachable block (#130190)
JIT: fix widened IV init placed in unreachable block (#130190)
[release/10.0] JIT: fix widened IV init placed in unreachable block (#…