From: Jürg Billeter Date: Tue, 21 May 2013 04:52:02 +0000 (+0200) Subject: Fix C code generated for local string array constants X-Git-Tag: 0.21.1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4832bf273f8afaa501417d60d2e5c836ad6145;p=thirdparty%2Fvala.git Fix C code generated for local string array constants Fixes bug 646970. --- diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 9f090f3ed..9ee008bf9 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -1,6 +1,6 @@ /* valaparser.vala * - * Copyright (C) 2006-2011 Jürg Billeter + * Copyright (C) 2006-2013 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 @@ -1751,6 +1751,13 @@ public class Vala.Parser : CodeVisitor { void parse_local_constant_declarations (Block block) throws ParseError { expect (TokenType.CONST); var constant_type = parse_type (false, false); + + // constant arrays don't own their element + var array_type = constant_type as ArrayType; + if (array_type != null) { + array_type.element_type.value_owned = false; + } + do { DataType type_copy = constant_type.copy (); var local = parse_local_constant (type_copy);