[vala/0.12] codegen: Remove incorrect check when returning arrays from async methods



commit 7aad821bfd6f3f323a2337d73da2ff356cf738f6
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jun 1 16:23:44 2011 +0200

    codegen: Remove incorrect check when returning arrays from async methods

 codegen/valaccodebasemodule.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 3d8c07f..af937de 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3373,13 +3373,15 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
 			for (int dim = 1; dim <= array_type.rank; dim++) {
 				var len_l = get_result_cexpression (get_array_length_cname ("result", dim));
-				ccode.open_if (len_l);
+				var len_r = get_array_length_cexpression (stmt.return_expression, dim);
 				if (!is_in_coroutine ()) {
+					ccode.open_if (len_l);
 					len_l = new CCodeUnaryExpression (CCodeUnaryOperator.POINTER_INDIRECTION, len_l);
+					ccode.add_assignment (len_l, len_r);
+					ccode.close ();
+				} else {
+					ccode.add_assignment (len_l, len_r);
 				}
-				var len_r = get_array_length_cexpression (stmt.return_expression, dim);
-				ccode.add_assignment (len_l, len_r);
-				ccode.close ();
 			}
 
 			set_cvalue (stmt.return_expression, get_variable_cexpression (return_expr_decl.name));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]