]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix array size variable on assignment
authorJürg Billeter <j@bitron.ch>
Sat, 2 Apr 2011 16:01:24 +0000 (18:01 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 2 Apr 2011 16:05:32 +0000 (18:05 +0200)
The array size of the right-hand side should not be used as the copy may
have a different size.

Fixes bug 646294.

codegen/valaccodeassignmentmodule.vala

index 1bc79f271b8809501455ce6ed18a36c7d5576cf8..ab9285b2ee25641a9b032e2f34af42bacf9b9f25 100644 (file)
@@ -199,11 +199,7 @@ public class Vala.CCodeAssignmentModule : CCodeMemberAccessModule {
                                }
                                if (array_type.rank == 1) {
                                        if (get_array_size_cvalue (lvalue) != null) {
-                                               if (get_array_size_cvalue (value) != null) {
-                                                       ccode.add_assignment (get_array_size_cvalue (lvalue), get_array_size_cvalue (value));
-                                               } else {
-                                                       ccode.add_assignment (get_array_size_cvalue (lvalue), get_array_length_cvalue (value, 1));
-                                               }
+                                               ccode.add_assignment (get_array_size_cvalue (lvalue), get_array_length_cvalue (value, 1));
                                        }
                                }
                        }