Skip to content

Commit 6d1b552

Browse files
janvorlimdh1418
authored andcommitted
Fix dynamic class zeroing (dotnet#80822)
Recent change in the `ThreadLocalModule::AllocateDynamicClass` has accidentally removed zeroing for new CollectibleDynamicEntry instances. That leads to crashes when running code in an unloadable context. This change fixes that.
1 parent f2905ed commit 6d1b552

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/coreclr/vm/threadstatics.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ struct ThreadLocalModule
9696
LIMITED_METHOD_CONTRACT;
9797
}
9898

99-
LOADERHANDLE m_hGCStatics;
100-
LOADERHANDLE m_hNonGCStatics;
101-
PTR_LoaderAllocator m_pLoaderAllocator;
99+
LOADERHANDLE m_hGCStatics = NULL;
100+
LOADERHANDLE m_hNonGCStatics = NULL;
101+
PTR_LoaderAllocator m_pLoaderAllocator = NULL;
102102
};
103103
typedef DPTR(CollectibleDynamicEntry) PTR_CollectibleDynamicEntry;
104104

0 commit comments

Comments
 (0)