diff --git a/CCIProvider/TypeExtractor.cs b/CCIProvider/TypeExtractor.cs index 19e64dda..b340fd52 100644 --- a/CCIProvider/TypeExtractor.cs +++ b/CCIProvider/TypeExtractor.cs @@ -972,7 +972,7 @@ private void ExtractParameters(IList dest, IEnumerable signature, SRM.Paramete private static MethodParameterKind GetParameterKind(SR.ParameterAttributes attributes, IType type) { - var result = MethodParameterKind.In; + var result = MethodParameterKind.Normal; var isOut = attributes.HasFlag(SR.ParameterAttributes.Out); + var isIn = attributes.HasFlag(SR.ParameterAttributes.In); if (isOut) { result = MethodParameterKind.Out; } + else if (isIn) + { + result = MethodParameterKind.In; + } else if (type.IsPointer()) { result = MethodParameterKind.Ref; diff --git a/Model/ThreeAddressCode/Instructions.cs b/Model/ThreeAddressCode/Instructions.cs index 270fde50..d38675a3 100644 --- a/Model/ThreeAddressCode/Instructions.cs +++ b/Model/ThreeAddressCode/Instructions.cs @@ -936,7 +936,8 @@ public override ISet ModifiedVariables // We don't care here if the objects referenced by arguments could be modified. foreach (var parameterInfo in this.Method.Parameters) { - if (parameterInfo.Kind == MethodParameterKind.Ref) + if (parameterInfo.Kind == MethodParameterKind.Ref || + parameterInfo.Kind == MethodParameterKind.Out) { var argument = this.Arguments[argumentIndex++]; result.Add(argument); @@ -1017,7 +1018,8 @@ public override ISet ModifiedVariables // We don't care here if the objects referenced by arguments could be modified. foreach (var parameterInfo in this.Function.Parameters) { - if (parameterInfo.Kind == MethodParameterKind.Ref) + if (parameterInfo.Kind == MethodParameterKind.Ref || + parameterInfo.Kind == MethodParameterKind.Out) { var argument = this.Arguments[argumentIndex++]; result.Add(argument); diff --git a/Model/Types/TypeDefinitions.cs b/Model/Types/TypeDefinitions.cs index 27062ea7..34c59619 100644 --- a/Model/Types/TypeDefinitions.cs +++ b/Model/Types/TypeDefinitions.cs @@ -161,9 +161,10 @@ public override string ToString() public enum MethodParameterKind { - In, - Out, - Ref + Normal, // none + In, // in keyword + Out, // out keyword + Ref // ref keyword } public interface IMethodParameterReference @@ -183,7 +184,7 @@ public MethodParameterReference(ushort index, IType type) { this.Index = index; this.Type = type; - this.Kind = MethodParameterKind.In; + this.Kind = MethodParameterKind.Normal; } public override string ToString() @@ -192,7 +193,8 @@ public override string ToString() switch (this.Kind) { - case MethodParameterKind.In: kind = string.Empty; break; + case MethodParameterKind.Normal: kind = String.Empty; break; + case MethodParameterKind.In: kind = "in "; break; case MethodParameterKind.Out: kind = "out "; break; case MethodParameterKind.Ref: kind = "ref "; break; @@ -233,7 +235,7 @@ public MethodParameter(ushort index, string name, IType type) this.Index = index; this.Name = name; this.Type = type; - this.Kind = MethodParameterKind.In; + this.Kind = MethodParameterKind.Normal; this.Attributes = new HashSet(); } @@ -265,7 +267,8 @@ public override string ToString() switch (this.Kind) { - case MethodParameterKind.In: kind = string.Empty; break; + case MethodParameterKind.Normal: kind = string.Empty; break; + case MethodParameterKind.In: kind = "in "; break; case MethodParameterKind.Out: kind = "out "; break; case MethodParameterKind.Ref: kind = "ref "; break;