From 662be860654b5a3bba670aff507784d265cfe542 Mon Sep 17 00:00:00 2001 From: John Chen Date: Fri, 3 Jun 2016 10:18:37 -0700 Subject: [PATCH] Fix desktop NGen break caused by CoreCLR change, and add a missing contract [tfs-changeset: 1610323] Commit migrated from https://github.com/dotnet/coreclr/commit/5f455600c0e0155d80bd814d4a60b44f6ac6bcbb --- src/coreclr/src/vm/compile.h | 1 + src/coreclr/src/vm/genericdict.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/compile.h b/src/coreclr/src/vm/compile.h index 97c6cc1..c7a2d06 100644 --- a/src/coreclr/src/vm/compile.h +++ b/src/coreclr/src/vm/compile.h @@ -531,6 +531,7 @@ class CEEPreloader : public ICorCompilePreloader void AppendUncompiledMethod(MethodDesc *pMD) { + STANDARD_VM_CONTRACT; if (m_methodCompileLimit > 0) { m_uncompiledMethods.Append(pMD); diff --git a/src/coreclr/src/vm/genericdict.cpp b/src/coreclr/src/vm/genericdict.cpp index 65638d1..dfb9ea9 100644 --- a/src/coreclr/src/vm/genericdict.cpp +++ b/src/coreclr/src/vm/genericdict.cpp @@ -682,7 +682,10 @@ Dictionary::PopulateEntry( th = th.GetMethodTable()->GetMethodTableMatchingParentClass(declaringType.AsMethodTable()); } - th.GetMethodTable()->EnsureInstanceActive(); + if (!IsCompilationProcess()) + { + th.GetMethodTable()->EnsureInstanceActive(); + } result = (CORINFO_GENERIC_HANDLE)th.AsPtr(); break; @@ -917,7 +920,10 @@ Dictionary::PopulateEntry( DWORD fieldIndex; IfFailThrow(ptr.GetData(&fieldIndex)); - th.AsMethodTable()->EnsureInstanceActive(); + if (!IsCompilationProcess()) + { + th.AsMethodTable()->EnsureInstanceActive(); + } result = (CORINFO_GENERIC_HANDLE)th.AsMethodTable()->GetFieldDescByIndex(fieldIndex); break; -- 2.7.4