From: Jürg Billeter Date: Sun, 6 Sep 2009 05:55:13 +0000 (+0200) Subject: Consider fixed length array variables as defined X-Git-Tag: 0.7.6~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d7ee152bce9eca6c3e90a872923b15d352f9f7e;p=thirdparty%2Fvala.git Consider fixed length array variables as defined --- diff --git a/vala/valadeclarationstatement.vala b/vala/valadeclarationstatement.vala index 3f6c90e27..428d88ef6 100644 --- a/vala/valadeclarationstatement.vala +++ b/vala/valadeclarationstatement.vala @@ -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 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); + } } }