diff options
author | Zoltan Varga <vargaz@gmail.com> | 2019-08-29 20:06:13 +0300 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2019-08-29 20:08:44 +0300 |
commit | caa8e7f54279a47422626005d228447f5d3670d5 (patch) | |
tree | 2d20b08107213d29591d80f8fb55301172b1a62a | |
parent | f9c1e2fec05127bb840488482b6aff1a0a942f3c (diff) |
Allow cattrs on generic param constraints, recent roslyn versions seems to generate them.
-rw-r--r-- | reflect/CustomAttributeData.cs | 2 | ||||
-rw-r--r-- | reflect/Metadata/Tables.cs | 2 | ||||
-rw-r--r-- | reflect/Reader/MetadataReader.cs | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/reflect/CustomAttributeData.cs b/reflect/CustomAttributeData.cs index b9574d56..9da38ce6 100644 --- a/reflect/CustomAttributeData.cs +++ b/reflect/CustomAttributeData.cs @@ -412,7 +412,7 @@ namespace IKVM.Reflection } else { - throw new InvalidOperationException(); + throw new InvalidOperationException(type.ToString()); } } diff --git a/reflect/Metadata/Tables.cs b/reflect/Metadata/Tables.cs index 75ceef7c..491c1ba1 100644 --- a/reflect/Metadata/Tables.cs +++ b/reflect/Metadata/Tables.cs @@ -1244,6 +1244,8 @@ namespace IKVM.Reflection.Metadata return (token & 0xFFFFFF) << 5 | 18; case GenericParamTable.Index: return (token & 0xFFFFFF) << 5 | 19; + case GenericParamConstraintTable.Index: + return (token & 0xFFFFFF) << 5 | 20; default: throw new InvalidOperationException(); } diff --git a/reflect/Reader/MetadataReader.cs b/reflect/Reader/MetadataReader.cs index 28a4720d..7d7cf669 100644 --- a/reflect/Reader/MetadataReader.cs +++ b/reflect/Reader/MetadataReader.cs @@ -226,6 +226,8 @@ namespace IKVM.Reflection.Reader return (ManifestResourceTable.Index << 24) + (codedIndex >> 5); case 19: return (GenericParamTable.Index << 24) + (codedIndex >> 5); + case 20: + return (GenericParamConstraintTable.Index << 24) + (codedIndex >> 5); default: throw new BadImageFormatException(); } |