diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-06-13 18:47:36 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-06-13 18:47:36 +0900 |
commit | 61d6a817e39d3bae0f47dbc09838d51db22a5d30 (patch) | |
tree | cb37caa1784bc738b976273335d6ed04a7cc80b0 /src/vm/pefile.cpp | |
parent | 5b975f8233e8c8d17b215372f89ca713b45d6a0b (diff) | |
download | coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.gz coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.tar.bz2 coreclr-61d6a817e39d3bae0f47dbc09838d51db22a5d30.zip |
Imported Upstream version 2.0.0.11992upstream/2.0.0.11992
Diffstat (limited to 'src/vm/pefile.cpp')
-rw-r--r-- | src/vm/pefile.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp index 16c66b516d..c7870e6366 100644 --- a/src/vm/pefile.cpp +++ b/src/vm/pefile.cpp @@ -2849,12 +2849,22 @@ PTR_ICLRPrivBinder PEFile::GetBindingContext() PTR_ICLRPrivBinder pBindingContext = NULL; - // Mscorlib is always bound in context of the TPA Binder. However, since it gets loaded and published - // during EEStartup *before* TPAbinder is initialized, we dont have a binding context to publish against. + // CoreLibrary is always bound in context of the TPA Binder. However, since it gets loaded and published + // during EEStartup *before* DefaultContext Binder (aka TPAbinder) is initialized, we dont have a binding context to publish against. // Thus, we will always return NULL for its binding context. if (!IsSystem()) { pBindingContext = dac_cast<PTR_ICLRPrivBinder>(GetHostAssembly()); + if (!pBindingContext) + { + // If we do not have any binding context, check if we are dealing with + // a dynamically emitted assembly and if so, use its fallback load context + // binder reference. + if (IsDynamic()) + { + pBindingContext = GetFallbackLoadContextBinder(); + } + } } return pBindingContext; |