diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-01 12:03:26 -0700 |
---|---|---|
committer | Gaurav Khanna <gkhanna@microsoft.com> | 2016-08-09 12:59:46 -0700 |
commit | 4ed1a0cb90d85afb4a5c60be4e9f412048c5e187 (patch) | |
tree | b4015ffa0889515097d33efeb46072c053e045b2 /src/vm/assemblyspec.hpp | |
parent | 17ced7fea35cb89ce6fe6c0a614c9fe15171bdea (diff) | |
download | coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.gz coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.tar.bz2 coreclr-4ed1a0cb90d85afb4a5c60be4e9f412048c5e187.zip |
Fix LoadFromAssemblyName to invoke fallback context (analogous to static assembly loads within the context)
Diffstat (limited to 'src/vm/assemblyspec.hpp')
-rw-r--r-- | src/vm/assemblyspec.hpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/vm/assemblyspec.hpp b/src/vm/assemblyspec.hpp index 84e67dfcc2..a7e9c0f203 100644 --- a/src/vm/assemblyspec.hpp +++ b/src/vm/assemblyspec.hpp @@ -45,6 +45,9 @@ class AssemblySpec : public BaseAssemblySpec #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) // Contains the reference to the fallback load context associated with RefEmitted assembly requesting the load of another assembly (static or dynamic) ICLRPrivBinder *m_pFallbackLoadContextBinder; + + // Flag to indicate if we should prefer the fallback load context binder for binding or not. + bool m_fPreferFallbackLoadContextBinder; #endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER) BOOL IsValidAssemblyName(); @@ -74,7 +77,8 @@ class AssemblySpec : public BaseAssemblySpec m_pParentAssembly = NULL; #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) - m_pFallbackLoadContextBinder = NULL; + m_pFallbackLoadContextBinder = NULL; + m_fPreferFallbackLoadContextBinder = false; #endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER) } @@ -86,7 +90,8 @@ class AssemblySpec : public BaseAssemblySpec m_pParentAssembly = NULL; #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) - m_pFallbackLoadContextBinder = NULL; + m_pFallbackLoadContextBinder = NULL; + m_fPreferFallbackLoadContextBinder = false; #endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER) } @@ -187,6 +192,20 @@ class AssemblySpec : public BaseAssemblySpec return m_pFallbackLoadContextBinder; } + + void SetPreferFallbackLoadContextBinder() + { + LIMITED_METHOD_CONTRACT; + + m_fPreferFallbackLoadContextBinder = true; + } + + bool GetPreferFallbackLoadContextBinder() + { + LIMITED_METHOD_CONTRACT; + + return m_fPreferFallbackLoadContextBinder; + } #endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER) // Note that this method does not clone the fields! @@ -208,6 +227,7 @@ class AssemblySpec : public BaseAssemblySpec #if defined(FEATURE_HOST_ASSEMBLY_RESOLVER) // Copy the details of the fallback load context binder SetFallbackLoadContextBinderForRequestingAssembly(pSource->GetFallbackLoadContextBinderForRequestingAssembly()); + m_fPreferFallbackLoadContextBinder = pSource->GetPreferFallbackLoadContextBinder(); #endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER) m_HashForControl = pSource->m_HashForControl; |