From: Jürg Billeter Date: Mon, 22 Mar 2010 22:18:06 +0000 (+0100) Subject: Fix private fixed-length array fields X-Git-Tag: 0.8.0~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8856b7ea969084de76df674209b071a7e8ddf0b6;p=thirdparty%2Fvala.git Fix private fixed-length array fields Fixes bug 609171. --- diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala index bda333228..b95e375f7 100644 --- a/codegen/valagtypemodule.vala +++ b/codegen/valagtypemodule.vala @@ -413,18 +413,20 @@ internal class Vala.GTypeModule : GErrorModule { if (f.access == SymbolAccessibility.PRIVATE) { generate_type_declaration (f.field_type, decl_space); - instance_priv_struct.add_field (field_ctype, f.get_cname ()); + instance_priv_struct.add_field (field_ctype, f.get_cname (), f.field_type.get_cdeclarator_suffix ()); if (f.field_type is ArrayType && !f.no_array_length) { // create fields to store array dimensions var array_type = (ArrayType) f.field_type; var len_type = int_type.copy (); - for (int dim = 1; dim <= array_type.rank; dim++) { - instance_priv_struct.add_field (len_type.get_cname (), head.get_array_length_cname (f.name, dim)); - } + if (!array_type.fixed_length) { + for (int dim = 1; dim <= array_type.rank; dim++) { + instance_priv_struct.add_field (len_type.get_cname (), head.get_array_length_cname (f.name, dim)); + } - if (array_type.rank == 1 && f.is_internal_symbol ()) { - instance_priv_struct.add_field (len_type.get_cname (), head.get_array_size_cname (f.name)); + if (array_type.rank == 1 && f.is_internal_symbol ()) { + instance_priv_struct.add_field (len_type.get_cname (), head.get_array_size_cname (f.name)); + } } } else if (f.field_type is DelegateType) { var delegate_type = (DelegateType) f.field_type;