]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix crash on valid recursive struct usage
authorJürg Billeter <j@bitron.ch>
Fri, 9 Apr 2010 07:52:17 +0000 (09:52 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 21 Apr 2010 12:04:17 +0000 (14:04 +0200)
Fixes bug 614417.

vala/valastruct.vala

index 0e5513c4913e38fcc2ad144a46e9a0f7243342dc..addd2db0955af90d41d3252b5f28d54cd4413171 100644 (file)
@@ -1,6 +1,6 @@
 /* valastruct.vala
  *
- * Copyright (C) 2006-2009  Jürg Billeter
+ * Copyright (C) 2006-2010  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
@@ -739,12 +739,9 @@ public class Vala.Struct : TypeSymbol {
 
        bool is_recursive_value_type (DataType type) {
                var struct_type = type as StructValueType;
-               if (struct_type != null) {
+               if (struct_type != null && !struct_type.nullable) {
                        var st = (Struct) struct_type.type_symbol;
                        if (st == this) {
-                               if (type.nullable) {
-                                       return false;
-                               }
                                return true;
                        }
                        foreach (Field f in st.fields) {