summaryrefslogtreecommitdiff
path: root/vala/valatypecheck.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2009-09-13 18:17:29 +0200
committerJürg Billeter <j@bitron.ch>2009-09-13 18:17:29 +0200
commit889a291d81c1f6aa6fbad2c237fbf35899c090da (patch)
tree91a17ee3854706a2cb9e997fa9009901bf4b15b2 /vala/valatypecheck.vala
parent1c75e80762a780f8585925177331378eadee042d (diff)
downloadvala-889a291d81c1f6aa6fbad2c237fbf35899c090da.tar.gz
Fix crash with type check expressions
Fixes bug 594399.
Diffstat (limited to 'vala/valatypecheck.vala')
-rw-r--r--vala/valatypecheck.vala15
1 files changed, 14 insertions, 1 deletions
diff --git a/vala/valatypecheck.vala b/vala/valatypecheck.vala
index 1f626aeb6..232633f68 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;