summaryrefslogtreecommitdiff
path: root/src/vm/genericdict.cpp
diff options
context:
space:
mode:
authorJohn Chen <jochen@microsoft.com>2016-05-28 10:34:22 -0700
committerJan Kotas <jkotas@microsoft.com>2016-05-28 10:34:22 -0700
commit80b11809300d2b762a5ce09bf5a69d9f7003d06b (patch)
tree0fe36cf3a59d1b7809721a7e913497f23c869414 /src/vm/genericdict.cpp
parent4aa7ce273f03d242fddfbe134aa6d0144045e2da (diff)
downloadcoreclr-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.cpp4
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;
}