[vala] Fix flow analysis for reference transfer expressions



commit b666de1c0901cb6d302c6dcadce517b1f936967f
Author: JÃrg Billeter <j bitron ch>
Date:   Mon Aug 1 21:12:03 2011 +0200

    Fix flow analysis for reference transfer expressions

 vala/valareferencetransferexpression.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/vala/valareferencetransferexpression.vala b/vala/valareferencetransferexpression.vala
index 29c522e..cd2f154 100644
--- a/vala/valareferencetransferexpression.vala
+++ b/vala/valareferencetransferexpression.vala
@@ -117,9 +117,23 @@ public class Vala.ReferenceTransferExpression : Expression {
 
 	public override void get_defined_variables (Collection<Variable> collection) {
 		inner.get_defined_variables (collection);
+		var local = inner.symbol_reference as LocalVariable;
+		var param = inner.symbol_reference as Parameter;
+		if (local != null) {
+			collection.add (local);
+		} else if (param != null && param.direction == ParameterDirection.OUT) {
+			collection.add (param);
+		}
 	}
 
 	public override void get_used_variables (Collection<Variable> collection) {
 		inner.get_used_variables (collection);
+		var local = inner.symbol_reference as LocalVariable;
+		var param = inner.symbol_reference as Parameter;
+		if (local != null) {
+			collection.add (local);
+		} else if (param != null && param.direction == ParameterDirection.OUT) {
+			collection.add (param);
+		}
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]