Skip to content

Commit 6c41d03

Browse files
committed
AssemblyMark in GC now marks generic static fields
1 parent da5608a commit 6c41d03

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/CLR/Core/GarbageCollector.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,17 @@ void CLR_RT_GarbageCollector::Assembly_Mark()
706706

707707
#if !defined(NANOCLR_APPDOMAINS)
708708
CheckMultipleBlocks(pASSM->staticFields, pASSM->staticFieldsCount);
709+
710+
// Mark generic static fields for each TypeSpec
711+
for (int i = 0; i < pASSM->tablesSize[TBL_TypeSpec]; i++)
712+
{
713+
CLR_RT_TypeSpec_CrossReference &ts = pASSM->crossReferenceTypeSpec[i];
714+
715+
if (ts.genericStaticFields != nullptr && ts.genericStaticFieldsCount > 0)
716+
{
717+
CheckMultipleBlocks(ts.genericStaticFields, ts.genericStaticFieldsCount);
718+
}
719+
}
709720
#endif
710721

711722
CheckSingleBlock(&pASSM->file);

0 commit comments

Comments
 (0)