From: Jürg Billeter Date: Sat, 19 Dec 2009 13:58:28 +0000 (+0100) Subject: Fix calling methods that have out parameters and return structs X-Git-Tag: 0.7.9~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfa683c26066e67888eef0a8895bf64028e346a3;p=thirdparty%2Fvala.git Fix calling methods that have out parameters and return structs --- diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index 4589cbf1b..87ddcc087 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -365,7 +365,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { // call function LocalVariable ret_temp_var = null; - if (itype.get_return_type () is VoidType) { + if (itype.get_return_type () is VoidType || itype.get_return_type ().is_real_struct_type ()) { ccomma.append_expression (ccall_expr); } else { ret_temp_var = get_temp_variable (itype.get_return_type (), true, null, false); @@ -389,7 +389,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { ccomma.append_expression (new CCodeAssignment ((CCodeExpression) unary.inner.ccodenode, cassign_comma)); // return value - if (!(itype.get_return_type () is VoidType)) { + if (!(itype.get_return_type () is VoidType || itype.get_return_type ().is_real_struct_type ())) { ccomma.append_expression (get_variable_cexpression (ret_temp_var.name)); }