diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-09-26 00:13:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-26 00:13:08 +0300 |
commit | 351d113aaa275354213aeb31bdc0709b56774508 (patch) | |
tree | 666d79966b82ab57ee86395d87734e9fe6a8b7d5 /src/System.Private.Reflection.Execution | |
parent | df72baade13edba30200737845f61689ecc90251 (diff) | |
parent | d68fc481dc48321d4f16780288f90e6118e62660 (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.cs | 9 |
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); |