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) Physical promotion: struct copy between overlapping slices of the same local is not done from a snapshot #133858
With LayoutKind.Explicit, two struct fields of the same local can overlap. Physical promotion decomposes s.P1 = s.P0 into sequential per-field stores without noticing the overlap, so a later store reads a slot an earlier store already overwrote. Affects .NET 10 as well.
Only overlapping copies where the destination starts above the source are wrong; s.P0 = s.P1 and non-overlapping explicit layouts are fine.
Root cause: in promotiondecomposition.cpp, ReplaceVisitor::HandleStructStore dispatches to CopyBetweenFields, which walks the destination/source replacement lists in parallel and never checks whether both sides are the same local with overlapping ranges.
Fix direction: copy via temps, order the per-field stores high-to-low when dst starts above src, or bail out of decomposition for such stores.
Activity
dotnet-policy-service commentedon Sep 14, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
EgorBo commentedon Sep 18, 2026
Affected SDK versions: