]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix initializer lists for structs with array fields
authorJürg Billeter <j@bitron.ch>
Tue, 5 Apr 2011 17:23:00 +0000 (19:23 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 5 Apr 2011 17:23:00 +0000 (19:23 +0200)
codegen/valaccodebasemodule.vala

index 2c7633e1f738d5cf18fe5ca4199aaf5d9858c62c..aab8d65b9ff4ce6377ecb52e4344417a0cf09e3b 100644 (file)
@@ -2125,6 +2125,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                        }
 
                                        clist.append (cexpr);
+
+                                       var array_type = field.variable_type as ArrayType;
+                                       if (array_type != null && !field.no_array_length && !field.array_null_terminated) {
+                                               for (int dim = 1; dim <= array_type.rank; dim++) {
+                                                       clist.append (get_array_length_cvalue (expr.target_value, dim));
+                                               }
+                                       }
                                }
 
                                set_cvalue (list, clist);