]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix temporary variable handling when using methods defined in VAPI files
authorJürg Billeter <j@bitron.ch>
Tue, 16 Dec 2008 22:12:04 +0000 (22:12 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 16 Dec 2008 22:12:04 +0000 (22:12 +0000)
2008-12-16  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodebasemodule.vala:
* gobject/valaccodemethodmodule.vala:

Fix temporary variable handling when using methods defined in
VAPI files

svn path=/trunk/; revision=2192

ChangeLog
gobject/valaccodebasemodule.vala
gobject/valaccodemethodmodule.vala

index d694ba6019ef9b7923d0d085ba66bf7c351442c8..451987771083396303b4de6da35ef9ab48fa09e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-16  Jürg Billeter  <j@bitron.ch>
+
+       * gobject/valaccodebasemodule.vala:
+       * gobject/valaccodemethodmodule.vala:
+
+       Fix temporary variable handling when using methods defined in
+       VAPI files
+
 2008-12-16  Jürg Billeter  <j@bitron.ch>
 
        * vapigen/valagidlparser.vala:
index 981b0f18607bb8886105b81ee182316135b33d37..bfc3008f2cb651958d6593309b457433e827fa3f 100644 (file)
@@ -139,7 +139,7 @@ public class Vala.CCodeBaseModule : CCodeModule {
 
        public Set<string> wrappers;
 
-       Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
+       public Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
        public CCodeBaseModule (CCodeGenerator codegen, CCodeModule? next) {
                base (codegen, next);
@@ -282,6 +282,7 @@ public class Vala.CCodeBaseModule : CCodeModule {
                user_marshal_set = new HashSet<string> (str_hash, str_equal);
                
                next_temp_var_id = 0;
+               variable_name_map.clear ();
                
                string_h_needed = false;
                gvaluecollector_h_needed = false;
@@ -1032,11 +1033,14 @@ public class Vala.CCodeBaseModule : CCodeModule {
                check_type (prop.property_type);
 
                int old_next_temp_var_id = next_temp_var_id;
+               var old_variable_name_map = variable_name_map;
                next_temp_var_id = 0;
+               variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
                prop.accept_children (codegen);
 
                next_temp_var_id = old_next_temp_var_id;
+               variable_name_map = old_variable_name_map;
 
                var cl = prop.parent_symbol as Class;
                if (cl != null && cl.is_subtype_of (gobject_type)
index 459cb4e01cb0615d159552eb112d32600dd5616b..bfd2b77c745d2246d7dd2e3cf10fa99f4eea5d48 100644 (file)
@@ -62,6 +62,7 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
                DataType old_return_type = current_return_type;
                bool old_method_inner_error = current_method_inner_error;
                int old_next_temp_var_id = next_temp_var_id;
+               var old_variable_name_map = variable_name_map;
                if (m.parent_symbol is TypeSymbol) {
                        current_type_symbol = (TypeSymbol) m.parent_symbol;
                }
@@ -70,6 +71,7 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
                current_return_type = m.return_type;
                current_method_inner_error = false;
                next_temp_var_id = 0;
+               variable_name_map = new HashMap<string,string> (str_hash, str_equal);
 
                bool in_gtypeinstance_creation_method = false;
                bool in_gobject_creation_method = false;
@@ -160,6 +162,7 @@ public class Vala.CCodeMethodModule : CCodeStructModule {
                current_return_type = old_return_type;
                current_method_inner_error = old_method_inner_error;
                next_temp_var_id = old_next_temp_var_id;
+               variable_name_map = old_variable_name_map;
 
                function = new CCodeFunction (m.get_real_cname (), get_creturn_type (m, creturn_type.get_cname ()));
                m.ccodenode = function;