]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Revert "Fix regression when assigning owned expressions to unowned variables." c08dd2c82dcfe42f2f6fb23333eadf63ed2d7f22
authorLuca Bruno <luca.bruno@immobiliare.it>
Fri, 19 Sep 2014 12:43:45 +0000 (14:43 +0200)
committerLuca Bruno <luca.bruno@immobiliare.it>
Fri, 19 Sep 2014 12:43:56 +0000 (14:43 +0200)
This reverts commit ba1fa0759989dcbb9046c7dfc06cce6c4aa23411.

Due to bug #736774

vala/valasemanticanalyzer.vala

index 20600d3e44600c87e6429c5ac4be4c3fed1e7035..cb1a575f59674f0af8e70021070f8d10d070bb2a 100644 (file)
@@ -892,7 +892,8 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
        public static Expression create_temp_access (LocalVariable local, DataType? target_type) {
                Expression temp_access = new MemberAccess.simple (local.name, local.source_reference);
 
-               if (local.variable_type.is_disposable ()) {
+               var target_owned = target_type == null || target_type.value_owned;
+               if (target_owned && local.variable_type.is_disposable ()) {
                        temp_access = new ReferenceTransferExpression (temp_access, local.source_reference);
                        temp_access.target_type = target_type != null ? target_type.copy () : local.variable_type.copy ();
                        temp_access.target_type.value_owned = true;