From 34c75d28f6fd67761bdf593a3449691d8d089ed8 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Mon, 12 Sep 2016 01:44:39 +0300 Subject: [PATCH] Avoided ambiguous local variables when marshalling arrays. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpMarshal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpMarshal.cs b/src/Generator/Generators/CSharp/CSharpMarshal.cs index 36e6f723..acb1b9d7 100644 --- a/src/Generator/Generators/CSharp/CSharpMarshal.cs +++ b/src/Generator/Generators/CSharp/CSharpMarshal.cs @@ -418,7 +418,7 @@ namespace CppSharp.Generators.CSharp Context.SupportBefore.WriteLine("if ({0} == null || {0}.Length != {1})", Context.Parameter.Name, array.Size); ThrowArgumentOutOfRangeException(); - const string ptr = "__ptr"; + var ptr = "__ptr" + Context.ParameterIndex; Context.SupportBefore.WriteLine("fixed ({0}* {1} = {2})", array.Type, ptr, Context.Parameter.Name); Context.SupportBefore.WriteStartBraceIndent();