]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Move compiler internal variable to right block
authorJürg Billeter <j@bitron.ch>
Sun, 30 Nov 2008 14:59:15 +0000 (14:59 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 30 Nov 2008 14:59:15 +0000 (14:59 +0000)
2008-11-30  Jürg Billeter  <j@bitron.ch>

* vala/valamethodcall.vala:

Move compiler internal variable to right block

svn path=/trunk/; revision=2101

ChangeLog
vala/valamethodcall.vala

index 209f5425033036455e5aac1befe19152041aae19..215abd41a4a92b3cf6ab7ed1a2bf1884fcd2e1ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-30  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valamethodcall.vala:
+
+       Move compiler internal variable to right block
+
 2008-11-30  Jürg Billeter  <j@bitron.ch>
 
        * vala/valaelementaccess.vala:
index d7a3685d070587160f3cecdd0d35184d59fa2a59..de7de282a7cd755dc90b36338bca968a8351fa43 100644 (file)
@@ -431,6 +431,13 @@ public class Vala.MethodCall : Expression {
                                decl.check (analyzer);
                                temp_access.check (analyzer);
 
+                               // move temp variable to insert block to ensure the
+                               // variable is in the same block as the declaration
+                               // otherwise there will be scoping issues in the generated code
+                               var block = (Block) analyzer.current_symbol;
+                               block.remove_local_variable (local);
+                               analyzer.insert_block.add_local_variable (local);
+
                                analyzer.insert_block = old_insert_block;
 
                                old_parent_node.replace_expression (this, temp_access);