Skip to content

Commit

Permalink
Fix dynamic class zeroing (dotnet#80822)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
janvorli authored and mdh1418 committed Jan 24, 2023
1 parent f2905ed commit 6d1b552
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coreclr/vm/threadstatics.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ struct ThreadLocalModule
LIMITED_METHOD_CONTRACT;
}

LOADERHANDLE m_hGCStatics;
LOADERHANDLE m_hNonGCStatics;
PTR_LoaderAllocator m_pLoaderAllocator;
LOADERHANDLE m_hGCStatics = NULL;
LOADERHANDLE m_hNonGCStatics = NULL;
PTR_LoaderAllocator m_pLoaderAllocator = NULL;
};
typedef DPTR(CollectibleDynamicEntry) PTR_CollectibleDynamicEntry;

Expand Down

0 comments on commit 6d1b552

Please sign in to comment.