From: Jürg Billeter Date: Sun, 13 Sep 2009 16:17:29 +0000 (+0200) Subject: Fix crash with type check expressions X-Git-Tag: 0.7.6~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889a291d81c1f6aa6fbad2c237fbf35899c090da;p=thirdparty%2Fvala.git Fix crash with type check expressions Fixes bug 594399. --- 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;