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) loop hoisting moves a throwing idiv above a finalizable object allocation #134936
LICM hoists a / b into the loop preheader, ahead of a new F() that comes before it in the loop body. F is finalizable. When the division throws, the object was never allocated, so its finalizer never runs.
In HoistVisitor::PostOrderVisit, a helper call that can't be hoisted clears m_canHoistSideEffects only on MutatesHeap, MayRunCctor, or !NoThrow. CORINFO_HELP_NEWFAST passes all three checks, so the flag stays true and the throwing idiv gets hoisted above the allocation. The JIT should also check GTF_CALL_M_ALLOC_SIDE_EFFECTS (or HasSideEffects) here.
Activity
dotnet-policy-service commentedon Sep 30, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: Preserve finalizable allocations during hoisting (#134971)