]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix calling methods that have out parameters and return structs
authorJürg Billeter <j@bitron.ch>
Sat, 19 Dec 2009 13:58:28 +0000 (14:58 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 19 Dec 2009 13:58:28 +0000 (14:58 +0100)
codegen/valaccodemethodcallmodule.vala

index 4589cbf1b1a4237c87e226e8dc1515d0ef939a71..87ddcc087cfa9eb06c4c803f7d7ad0c9fd28cea7 100644 (file)
@@ -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));
                                                }