]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix foreach for inline-allocated arrays
authorJürg Billeter <j@bitron.ch>
Fri, 29 Jan 2010 21:35:50 +0000 (22:35 +0100)
committerJürg Billeter <j@bitron.ch>
Fri, 29 Jan 2010 21:40:49 +0000 (22:40 +0100)
Fixes bug 607547.

vala/valaforeachstatement.vala

index b12440e3031ebabbb5deb3e8a09b81b551baf648..0975c82d48e0cb71e8042cfe25fc76149f552da0 100644 (file)
@@ -1,6 +1,6 @@
 /* valaforeachstatement.vala
  *
- * Copyright (C) 2006-2009  Jürg Billeter
+ * Copyright (C) 2006-2010  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
@@ -170,6 +170,9 @@ public class Vala.ForeachStatement : Block {
                if (collection_type.is_array ()) {
                        var array_type = (ArrayType) collection_type;
 
+                       // can't use inline-allocated array for temporary variable
+                       array_type.inline_allocated = false;
+
                        return check_without_iterator (analyzer, collection_type, array_type.element_type);
                } else if (collection_type.compatible (analyzer.glist_type) || collection_type.compatible (analyzer.gslist_type)) {
                        if (collection_type.get_type_arguments ().size != 1) {