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) Assert varTypeIsIntegral(type) || varTypeIsGC(type) in morph: comma-throw propagated into a struct-typed parent #133862
fgPropagateCommaThrow calls BashToZeroConst(genActualType(parent)) for any non-void parent. With a
struct-typed parent (here a GT_BLK from a struct array load) this asserts in a Checked JIT and builds
malformed struct-typed CNS_INT IR in Release.
Requires DOTNET_TieredCompilation=0; at tier-0 the folding does not happen.
Expected
OverflowException
Actual
Assert failure(PID 148588 [0x0002446c], Thread: 59900 [0xe9fc]): Assertion failed
'varTypeIsIntegral(type) || varTypeIsGC(type)' in 'Program:Test(S[]):S' during 'Morph - Global'
(IL size 21; hash 0xb183d2e0; FullOpts)
File: src\coreclr\jit\compiler.hpp:2191
Process exits with 0xC0000409.
Notes
After inlining, gtFoldExprConst turns the always-throwing checked cast into COMMA(throw, 0), which fgPropagateCommaThrow then propagates into the struct-typed parent; it should bail out (or use a different
"zero" representation) when the parent is not integral/GC-typed. Span<S> indexing and S s = a[Idx(long.MaxValue)]; hit the same assert.
Release .NET 10.0.12 prints OverflowException — this is a Checked-assert / malformed-IR issue, not a known
silent bad-codegen bug.
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.
JIT: Guard comma throw propagation types (#134387)