File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/Generator/Generators/C Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -586,9 +586,15 @@ private void MarshalRefClass(Class @class)
586
586
}
587
587
588
588
var paramType = Context . Parameter . Type . Desugar ( ) ;
589
- var deref = paramType . SkipPointerRefs ( ) . IsPointer ( ) ? "->" : "." ;
590
- Context . Return . Write ( $ "(::{ @class . QualifiedOriginalName } *)") ;
591
- Context . Return . Write ( $ "{ Context . Parameter . Name } { deref } { Helpers . InstanceIdentifier } ") ;
589
+ var isPointer = paramType . SkipPointerRefs ( ) . IsPointer ( ) ;
590
+ var deref = isPointer ? "->" : "." ;
591
+ var instance = $ "(::{ @class . QualifiedOriginalName } *)" +
592
+ $ "{ Context . Parameter . Name } { deref } { Helpers . InstanceIdentifier } ";
593
+
594
+ if ( isPointer )
595
+ Context . Return . Write ( $ "{ Context . Parameter . Name } ? { instance } : nullptr") ;
596
+ else
597
+ Context . Return . Write ( $ "{ instance } ") ;
592
598
}
593
599
594
600
private void MarshalValueClass ( Class @class )
You can’t perform that action at this time.
0 commit comments