Created
June 10, 2015 06:23
-
-
Save genuinelucifer/d73aa4039903b0c06e6d to your computer and use it in GitHub Desktop.
Fixed CSharp code generation when passing CS_OUT pointer into a function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generat | |
index 90cc6c1..aa983f2 100644 | |
--- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs | |
+++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs | |
@@ -2523,7 +2523,10 @@ public struct ParamMarshal | |
var paramType = param.Type; | |
Class @class; | |
- if (paramType.Desugar().TryGetClass(out @class) && @class.IsRef | |
+ if ( (paramType.Desugar().TryGetClass(out @class) || | |
+ (paramType.IsPointer() && paramType.GetFinalPointee() | |
+ .Desugar().TryGetClass(out @class))) | |
+ && @class.IsRefType) | |
{ | |
WriteLine("{0} = new {1}();", param.Name, paramType); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment