Browse Source

Fix MetadataParameter.IsRef if TypeSystemOptions.ReadOnlyStructsAndParameters is disabled.

pull/1243/head
Siegfried Pammer 8 years ago
parent
commit
87456ffdfa
  1. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs

@ -85,6 +85,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -85,6 +85,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get {
if (!(Type.Kind == TypeKind.ByReference && (attributes & inOut) != ParameterAttributes.Out))
return false;
if ((module.TypeSystemOptions & TypeSystemOptions.ReadOnlyStructsAndParameters) == 0)
return true;
var metadata = module.metadata;
var parameterDef = metadata.GetParameter(handle);
return !parameterDef.GetCustomAttributes().HasKnownAttribute(metadata, KnownAttribute.IsReadOnly);

Loading…
Cancel
Save