Passing an (unowned string) array literal to a function causes the array
elements to be freed afterwards, even though they should not be. This
causes the array elements to be double freed. While assigning the literal
to an intermediate variable and passing that to the function masks this
error of the ArrayCreationExpression.
https://bugzilla.gnome.org/show_bug.cgi?id=761307
basic-types/bug686336.vala \
basic-types/bug729907.vala \
basic-types/bug731017.vala \
+ basic-types/bug761307.vala \
namespaces.vala \
methods/lambda.vala \
methods/closures.vala \
--- /dev/null
+void bar ((unowned string)[] str) {
+}
+
+void foo () {
+ unowned string s1 = "ABC", s2 = "CDE";
+ bar ({s1, s2});
+ var s3 = "%s%s".printf (s1, s2);
+}
+
+void main () {
+ foo ();
+}
return false;
}
- element_type.value_owned = true;
-
value_type = new ArrayType (element_type, rank, source_reference);
value_type.value_owned = true;