[vala] Fix crash with type check expressions



commit 889a291d81c1f6aa6fbad2c237fbf35899c090da
Author: Jürg Billeter <j bitron ch>
Date:   Sun Sep 13 18:17:29 2009 +0200

    Fix crash with type check expressions
    
    Fixes bug 594399.

 vala/valatypecheck.vala |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/vala/valatypecheck.vala b/vala/valatypecheck.vala
index 1f626ae..232633f 100644
--- a/vala/valatypecheck.vala
+++ b/vala/valatypecheck.vala
@@ -29,7 +29,13 @@ public class Vala.TypeCheck : Expression {
 	/**
 	 * The expression to be checked.
 	 */
-	public Expression expression { get; set; }
+	public Expression expression {
+		get { return _expression; }
+		set {
+			_expression = value;
+			_expression.parent_node = this;
+		}
+	}
 	
 	/**
 	 * The type to be matched against.
@@ -42,6 +48,7 @@ public class Vala.TypeCheck : Expression {
 		}
 	}
 
+	Expression _expression;
 	private DataType _data_type;
 
 	/**
@@ -78,6 +85,12 @@ public class Vala.TypeCheck : Expression {
 		}
 	}
 
+	public override void replace_expression (Expression old_node, Expression new_node) {
+		if (expression == old_node) {
+			expression = new_node;
+		}
+	}
+
 	public override bool check (SemanticAnalyzer analyzer) {
 		if (checked) {
 			return !error;



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