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) tuple swap of struct locals with a class-init static struct field reads the new value #135809
A tuple swap of struct locals, where one source is a static struct field whose class needs initialization, reads the new value of a local instead of the old one. This is silent bad codegen at both Tier0 and FullOpts.
Reproduces on main. The original investigation also saw it on .NET 10.0.13 (not re-verified), so it's likely not a recent regression.
Configuration
main, Checked, win-x64. Reproduces at Tier0 and FullOpts.
Other information
At block start, Roslyn emits ldarg.1; ldsfld C::F; starg.s 1; starg.s 0. The importer imports ldsfld C::F as COMMA(GET_GCSTATIC_BASE, BLK). Because impLastStmt == nullptr, impStoreStruct sinks the store under the COMMA. impAppendStmt doesn't treat the COMMA-rooted store as a local store, so it never calls impSpillLclRefs(V01). The pending LCL_VAR V01 on the stack is then evaluated after the store.
Activity
dotnet-policy-service commentedon Oct 14, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: spill local refs for COMMA-wrapped local stores in impAppendStmt (…