diff --git a/src/coreclr/jit/async.cpp b/src/coreclr/jit/async.cpp index 4d43458c89e569..a44b6d92c0832c 100644 --- a/src/coreclr/jit/async.cpp +++ b/src/coreclr/jit/async.cpp @@ -506,8 +506,7 @@ bool AsyncLiveness::IsLive(unsigned lclNum) LclVarDsc* dsc = m_comp->lvaGetDesc(lclNum); - if ((dsc->TypeIs(TYP_BYREF) && !dsc->IsImplicitByRef()) || - (dsc->TypeIs(TYP_STRUCT) && dsc->GetLayout()->HasGCByRef())) + if (dsc->TypeIs(TYP_BYREF) && !dsc->IsImplicitByRef()) { // Even if these are address exposed we expect them to be dead at // suspension points. TODO: It would be good to somehow verify these @@ -516,6 +515,12 @@ bool AsyncLiveness::IsLive(unsigned lclNum) return false; } + if ((dsc->TypeIs(TYP_STRUCT) || dsc->IsImplicitByRef()) && dsc->GetLayout()->HasGCByRef()) + { + // Same as above + return false; + } + if (!m_hasLiveness) { return true;