Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2017-09-26 00:13:08 +0300
committerGitHub <noreply@github.com>2017-09-26 00:13:08 +0300
commit351d113aaa275354213aeb31bdc0709b56774508 (patch)
tree666d79966b82ab57ee86395d87734e9fe6a8b7d5 /src/System.Private.Reflection.Execution
parentdf72baade13edba30200737845f61689ecc90251 (diff)
parentd68fc481dc48321d4f16780288f90e6118e62660 (diff)
Merge pull request #4613 from dotnet/master
Merge master to nmirror
Diffstat (limited to 'src/System.Private.Reflection.Execution')
-rw-r--r--src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
index 295df6812..540fff054 100644
--- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
+++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
@@ -125,9 +125,14 @@ namespace Internal.Reflection.Execution
{
// For generic types, use the generic type definition
runtimeTypeHandle = GetTypeDefinition(runtimeTypeHandle);
-
var moduleHandle = RuntimeAugments.GetModuleFromTypeHandle(runtimeTypeHandle);
- NativeFormatModuleInfo module = ModuleList.Instance.GetModuleInfoByHandle(moduleHandle);
+
+ //make sure the module is actually NativeFormatModuleInfo, if the module
+ //doesnt have reflection enabled it wont be a NativeFormatModuleInfo
+ if (!(ModuleList.Instance.TryGetModuleInfoByHandle(moduleHandle, out ModuleInfo untypedModuleInfo) && (untypedModuleInfo is NativeFormatModuleInfo module)))
+ {
+ return true;
+ }
NativeReader blockedReflectionReader = GetNativeReaderForBlob(module, ReflectionMapBlob.BlockReflectionTypeMap);
NativeParser blockedReflectionParser = new NativeParser(blockedReflectionReader, 0);