diff options
author | John Chen <jochen@microsoft.com> | 2016-05-28 10:34:22 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-05-28 10:34:22 -0700 |
commit | 80b11809300d2b762a5ce09bf5a69d9f7003d06b (patch) | |
tree | 0fe36cf3a59d1b7809721a7e913497f23c869414 /src/vm/genericdict.cpp | |
parent | 4aa7ce273f03d242fddfbe134aa6d0144045e2da (diff) | |
download | coreclr-80b11809300d2b762a5ce09bf5a69d9f7003d06b.tar.gz coreclr-80b11809300d2b762a5ce09bf5a69d9f7003d06b.tar.bz2 coreclr-80b11809300d2b762a5ce09bf5a69d9f7003d06b.zip |
Ensure Ready-to-Run module is activated in generics dictionary lookup (#5288)
Under certain conditions, a Ready-to-Run module is not yet fully
activated when its contents are used. This can cause asserts in
debug build. It can also cause module constructor to be run too late.
Diffstat (limited to 'src/vm/genericdict.cpp')
-rw-r--r-- | src/vm/genericdict.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vm/genericdict.cpp b/src/vm/genericdict.cpp index 04e2550e1e..65638d1402 100644 --- a/src/vm/genericdict.cpp +++ b/src/vm/genericdict.cpp @@ -682,6 +682,8 @@ Dictionary::PopulateEntry( th = th.GetMethodTable()->GetMethodTableMatchingParentClass(declaringType.AsMethodTable()); } + th.GetMethodTable()->EnsureInstanceActive(); + result = (CORINFO_GENERIC_HANDLE)th.AsPtr(); break; } @@ -915,6 +917,8 @@ Dictionary::PopulateEntry( DWORD fieldIndex; IfFailThrow(ptr.GetData(&fieldIndex)); + th.AsMethodTable()->EnsureInstanceActive(); + result = (CORINFO_GENERIC_HANDLE)th.AsMethodTable()->GetFieldDescByIndex(fieldIndex); break; } |