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) NativeAOT: relational comparison of a type handle with a constant is folded using the compile-time handle placeholder #134891
Under NativeAOT, comparing a type handle against a numeric constant is folded using ILC's synthetic handle value (0x420000 + 8*n) instead of the real relocated address.
Test is compiled to xor eax, eax; ret. JIT mode prints True.
Regression?
No. Reproduces on .NET 8.0, 9.0, 10.0, 11.0-rc2 and main.
Notes
ValueNumStore::VNEvalCanFoldBinaryFunc rejects relocatable handles under compReloc for arithmetic and unsigned compares, but the GT_EQ/NE/GT/GE/LT/LE cases skip that check. gtFoldExprBinaryConstInt (via ImmedValCanBeFolded) has the same problem.
Activity
dotnet-policy-service commentedon Sep 29, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: preserve relocatable handles when simplifying ordered comparisons (