GNOME Bugzilla – Bug 736016
Ownership for assignments from methods throwing an error isn't checked
Last modified: 2018-05-22 15:18:11 UTC
A simple test-case which shows the problem. const string CONSTANT = "constant"; string get_owned_with_error () throws Error { return CONSTANT; } unowned string get_result_fail () { unowned string foo_unowned; foo_unowned = get_owned_with_error (); return foo_unowned; } void main () { assert (get_result_fail () == CONSTANT); }
Seems that the bad commit is: commit db462e6f919da758fbb2f4e7b3cbbf2897ec852b Author: Luca Bruno <lucabru@src.gnome.org> Date: Tue Jan 28 20:34:47 2014 +0100 Fix regression in method calls that throw errors with Value target type Related to bug 723009
Ok pulling the trigger. It may break applications because this is an error. It's worth noting this was an error in valac 0.22, the regression was silently introduced in valac 0.24. Now we're fixing it back re-enabling the error. Sorry for the inconvenience. Also the fix is very delicate, if you find any culprits while running your software please report back as soon as possible. Thanks. On a side note, this regression was due to missing negative regression tests. Our test suite has only positive tests. In this case we want the test to fail at compile-time, but we don't have proper support for this in our test suite. commit ba1fa0759989dcbb9046c7dfc06cce6c4aa23411 Author: Luca Bruno <luca.bruno@immobiliare.it> Date: Thu Sep 4 18:26:21 2014 +0200 Fix regression when assigning owned expressions to unowned variables. The regression was introduced by db462e6f919da758fb. Fixes bug 736016 This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
I'm currently looking at a problem introduced by this commit: bug #736774.
Reverted: commit c08dd2c82dcfe42f2f6fb23333eadf63ed2d7f22 Author: Luca Bruno <luca.bruno@immobiliare.it> Date: Fri Sep 19 14:43:45 2014 +0200 Revert "Fix regression when assigning owned expressions to unowned variables." This reverts commit ba1fa0759989dcbb9046c7dfc06cce6c4aa23411. Due to bug #736774 Better not have this in the next vala stable if I'm not able to fix it in time.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/475.