]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Get the instance using get_local_cvalue for object creation
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 8 May 2011 13:43:24 +0000 (15:43 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 8 May 2011 15:20:02 +0000 (17:20 +0200)
codegen/valaccodebasemodule.vala

index 0bf8a013aa73f5dcd660cd6116519d4288348a7b..062613d1218d755c47038a03c70ca1163167beb2 100644 (file)
@@ -4017,12 +4017,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                        var local = expr.parent_node as LocalVariable;
                        if (local != null && has_simple_struct_initializer (local)) {
-                               if (local.captured) {
-                                       var block = (Block) local.parent_symbol;
-                                       instance = new CCodeMemberAccess.pointer (get_variable_cexpression ("_data%d_".printf (get_block_id (block))), get_variable_cname (local.name));
-                               } else {
-                                       instance = get_variable_cexpression (get_variable_cname (local.name));
-                               }
+                               instance = get_cvalue_ (get_local_cvalue (local));
                        } else {
                                var temp_decl = get_temp_variable (expr.type_reference, false, expr);
                                emit_temp_var (temp_decl);