After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709665 - No warning when assigning string*[] value to string[] variable
No warning when assigning string*[] value to string[] variable
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Errors
0.22.x
Other All
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-08 18:30 UTC by Philip Withnall
Modified: 2017-03-22 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2013-10-08 18:30:08 UTC
If you assign a string*[] value to a string[] variable, e.g. with:
    string[] my_variable = my_g_variant.get_strv();
there is no warning, but Vala generates C code to free every member of the array. Looking at the type and documentation for Variant.get_strv(), this is incorrect, and results in double-frees of every member of the array.

Vala should throw a type error if the user attempts such an assignment.

This is with Vala 75359c3cab2e979d087ce0a19735bf86add33b42.
Comment 1 Rico Tzschichholz 2017-03-22 09:36:39 UTC
0.28+ produces working c-code.