From: Jürg Billeter Date: Fri, 29 Jan 2010 21:35:50 +0000 (+0100) Subject: Fix foreach for inline-allocated arrays X-Git-Tag: 0.7.10~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d68c083d48d083b0f4b636da910c624a4d7ed040;p=thirdparty%2Fvala.git Fix foreach for inline-allocated arrays Fixes bug 607547. --- diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala index b12440e30..0975c82d4 100644 --- a/vala/valaforeachstatement.vala +++ b/vala/valaforeachstatement.vala @@ -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) {