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) big-offset field load in a call argument is hoisted above the null check of an earlier argument (AV instead of NRE) #134473
A big-offset field load in a later call argument gets moved before the implicit null check done by an earlier argument. The process crashes with a fatal AccessViolationException when it should throw a NullReferenceException.
moveax, dword ptr [rcx+0x000186AC] ; o.B.Val, no null checkleaeax,[rax+2*rax]addedx,eaxmovecx, dword ptr [rcx+0x08] ; o.Small (the only remaining null check)call[Program:Foo(int,int):int]
Regression?
Not a regression. Reproduces on .NET 8, 9, 10, 11 RC2 and main (win-x64).
Notes
While morphing the args, local assertion prop uses the o != null assertion from arg0 (o.Small) to remove the explicit NULLCHECK of the big-offset access in arg1. arg1 then has no GTF_EXCEPT, so ArgsComplete doesn't force temps, and SortArgs moves arg1 before arg0. The assertion only holds after arg0 has been evaluated.
This is related to #133524, but it's a separate bug: once the NULLCHECK is gone, arg1 no longer carries GTF_ORDER_SIDEEFF.
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: preserve null check dependencies in call arguments (dotnet#137276)