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:
Diffstat (limited to 'src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs')
-rw-r--r--src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs
index 901d0f4ba..5896aa812 100644
--- a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs
+++ b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/General/MetadataReaderExtensions.NativeFormat.cs
@@ -162,6 +162,24 @@ namespace System.Reflection.Runtime.General
return customModifiers.ToArray();
}
+ public static Handle SkipCustomModifiers(this Handle handle, MetadataReader reader)
+ {
+ HandleType handleType = handle.HandleType;
+ Debug.Assert(handleType == HandleType.TypeDefinition || handleType == HandleType.TypeReference || handleType == HandleType.TypeSpecification || handleType == HandleType.ModifiedType);
+ if (handleType != HandleType.ModifiedType)
+ return handle;
+
+ do
+ {
+ ModifiedType modifiedType = handle.ToModifiedTypeHandle(reader).GetModifiedType(reader);
+ handle = modifiedType.Type;
+ handleType = handle.HandleType;
+ }
+ while (handleType == HandleType.ModifiedType);
+
+ return handle;
+ }
+
public static MethodSignature ParseMethodSignature(this Handle handle, MetadataReader reader)
{
return handle.ToMethodSignatureHandle(reader).GetMethodSignature(reader);