]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Consider fixed length array variables as defined
authorJürg Billeter <j@bitron.ch>
Sun, 6 Sep 2009 05:55:13 +0000 (07:55 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 6 Sep 2009 15:26:31 +0000 (17:26 +0200)
vala/valadeclarationstatement.vala

index 3f6c90e2725d806ec891408f983d8053ab906915..428d88ef69db0244e3e875cad5cad85410158260 100644 (file)
@@ -1,6 +1,6 @@
 /* valadeclarationstatement.vala
  *
- * Copyright (C) 2006-2008  Jürg Billeter
+ * Copyright (C) 2006-2009  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -88,9 +88,14 @@ public class Vala.DeclarationStatement : CodeNode, Statement {
 
        public override void get_defined_variables (Collection<LocalVariable> collection) {
                var local = declaration as LocalVariable;
-               if (local != null && local.initializer != null) {
-                       local.initializer.get_defined_variables (collection);
-                       collection.add (local);
+               if (local != null) {
+                       var array_type = local.variable_type as ArrayType;
+                       if (local.initializer != null) {
+                               local.initializer.get_defined_variables (collection);
+                               collection.add (local);
+                       } else if (array_type != null && array_type.fixed_length) {
+                               collection.add (local);
+                       }
                }
        }