// Tracks the last entry for each tracked register variable
- siScope* siLatestTrackedScopes[lclMAX_TRACKED];
+ siScope** siLatestTrackedScopes;
IL_OFFSET siLastEndOffs; // IL offset of the (exclusive) end of the last block processed
if (compiler->info.compVarScopesCount == 0)
{
- return;
+ siLatestTrackedScopes = nullptr;
}
-
+ else
+ {
#if FEATURE_EH_FUNCLETS
- siInFuncletRegion = false;
+ siInFuncletRegion = false;
#endif // FEATURE_EH_FUNCLETS
- for (unsigned i = 0; i < lclMAX_TRACKED; i++)
- {
- siLatestTrackedScopes[i] = nullptr;
- }
+ unsigned scopeCount = compiler->lvaTrackedCount;
- compiler->compResetScopeLists();
+ if (scopeCount == 0)
+ {
+ siLatestTrackedScopes = nullptr;
+ }
+ else
+ {
+ siLatestTrackedScopes =
+ static_cast<siScope**>(compiler->compGetMemArray(scopeCount, sizeof(siScope*), CMK_SiScope));
+
+ for (unsigned i = 0; i < scopeCount; i++)
+ {
+ siLatestTrackedScopes[i] = nullptr;
+ }
+ }
+
+ compiler->compResetScopeLists();
+ }
}
/*****************************************************************************
LclVarDsc* lclVar = &compiler->lvaTable[lclNum];
assert(lclVar->lvTracked);
#endif
-
- siScope* scope = siLatestTrackedScopes[varIndex];
siEndTrackedScope(varIndex);
}