]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix crash when assigning to dynamic properties
authorJürg Billeter <j@bitron.ch>
Sun, 11 Jan 2009 00:55:08 +0000 (00:55 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 11 Jan 2009 00:55:08 +0000 (00:55 +0000)
2009-01-11  Jürg Billeter  <j@bitron.ch>

* vala/valamemberaccess.vala:
* vala/valasemanticanalyzer.vala:

Fix crash when assigning to dynamic properties

svn path=/trunk/; revision=2329

ChangeLog
vala/valamemberaccess.vala
vala/valasemanticanalyzer.vala

index cb7656662968b40df2e3cd83afc940a7b7f11162..54e3fd2b34f5fb6069280d226f4c0322c2f5039f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-11  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valamemberaccess.vala:
+       * vala/valasemanticanalyzer.vala:
+
+       Fix crash when assigning to dynamic properties
+
 2009-01-10  Jürg Billeter  <j@bitron.ch>
 
        * vala/valacodenode.vala:
index 3ddcc53f4bb8a210207ce319aac5d2a1af931b4c..b7a31f1e113c752c8868c06b8ccb3617d25f5501 100644 (file)
@@ -1,6 +1,6 @@
 /* valamemberaccess.vala
  *
- * Copyright (C) 2006-2008  Jürg Billeter
+ * Copyright (C) 2006-2009  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -350,7 +350,7 @@ public class Vala.MemberAccess : Expression {
                                                // dynamic property assignment
                                                var prop = new DynamicProperty (inner.value_type, member_name, source_reference);
                                                prop.access = SymbolAccessibility.PUBLIC;
-                                               prop.set_accessor = new PropertyAccessor (false, true, false, prop.property_type.copy (), null, prop.source_reference);
+                                               prop.set_accessor = new PropertyAccessor (false, true, false, null, null, prop.source_reference);
                                                prop.set_accessor.access = SymbolAccessibility.PUBLIC;
                                                prop.owner = inner.value_type.data_type.scope;
                                                dynamic_object_type.type_symbol.scope.add (null, prop);
index 6740817206d4cebe353ad38d2de791eba0be86d3..3fb94451e48758f97e043879e66b156511708bd9 100644 (file)
@@ -163,11 +163,11 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                } else if (sym is Property) {
                        var prop = (Property) sym;
                        if (lvalue) {
-                               if (prop.set_accessor != null) {
+                               if (prop.set_accessor != null && prop.set_accessor.value_type != null) {
                                        return prop.set_accessor.value_type.copy ();
                                }
                        } else {
-                               if (prop.get_accessor != null) {
+                               if (prop.get_accessor != null && prop.get_accessor.value_type != null) {
                                        return prop.get_accessor.value_type.copy ();
                                }
                        }