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) multi-reg struct arg load re-reads the heap address per register (torn struct values) #134474
When a struct arg passed in multiple registers is loaded, the whole address tree is cloned for each register. So o.I is read twice, which violates the memory model ("reads cannot be re-done") and produces torn values.
Not a regression. Reproduces on .NET 8, 9, 10, 11 preview 3 and main (linux-x64). win-x64 isn't affected because it passes the struct by reference.
Notes
The bug shows up in Tier0/MinOpts code. NoOptimization is used only to make that deterministic. In optimized code, CSE happens to merge the two reads. It affects SysV x64 and arm64 (and probably other multi-reg-arg targets). fgTryMorphStructArg/createSlotAccess clones indirAddr and only checks GTF_PERSISTENT_SIDE_EFFECTS.
Activity
dotnet-policy-service commentedon Sep 22, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: don't re-read multi-reg struct arg addresses per register (dotne…