]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Don't emit extra temp variables in array dup funcs
authorRyan Lortie <desrt@desrt.ca>
Wed, 4 Aug 2010 18:02:43 +0000 (20:02 +0200)
committerRyan Lortie <desrt@desrt.ca>
Wed, 4 Aug 2010 18:06:45 +0000 (20:06 +0200)
Reset the temp variables list back to empty at the start of emitting the
array dup function and restore it at the end.

codegen/valaccodearraymodule.vala

index bec474c5b89beec3fefcd377ae08c3edef406b96..5d429e0274bc0d91df612d52038a387d023f9a49 100644 (file)
@@ -798,6 +798,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                        var old_symbol = current_symbol;
                        var old_temp_vars = temp_vars;
                        current_symbol = null;
+                       temp_vars = new ArrayList<LocalVariable> ();
 
                        var cdecl = new CCodeDeclaration (array_type.get_cname ());
                        var cvardecl = new CCodeVariableDeclarator ("result");
@@ -879,6 +880,7 @@ public class Vala.CCodeArrayModule : CCodeMethodCallModule {
                        var old_symbol = current_symbol;
                        var old_temp_vars = temp_vars;
                        current_symbol = null;
+                       temp_vars = new ArrayList<LocalVariable> ();
 
                        var idx_decl = new CCodeDeclaration ("int");
                        idx_decl.add_declarator (new CCodeVariableDeclarator ("i"));