[vala] Don't emit extra temp variables in array dup funcs



commit d0fdbda9edf1298d921e29036e912ecb47226d91
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Aug 4 20:02:43 2010 +0200

    Don't emit extra temp variables in array dup funcs
    
    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 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodearraymodule.vala b/codegen/valaccodearraymodule.vala
index bec474c..5d429e0 100644
--- a/codegen/valaccodearraymodule.vala
+++ b/codegen/valaccodearraymodule.vala
@@ -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"));



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