Fix criticals when using for statements without condition
authorJuerg Billeter <j@bitron.ch>
Wed, 23 Apr 2008 11:24:24 +0000 (11:24 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 23 Apr 2008 11:24:24 +0000 (11:24 +0000)
2008-04-23  Juerg Billeter  <j@bitron.ch>

* vala/valaforstatement.vala:
* ccode/valaccodeforstatement.vala:
Fix criticals when using for statements without condition

svn path=/trunk/; revision=1307

ChangeLog
ccode/valaccodeforstatement.vala
vala/valaforstatement.vala

index 32978eb..e61dee7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-04-23  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valaforstatement.vala:
+       * ccode/valaccodeforstatement.vala:
+       Fix criticals when using for statements without condition
+
+2008-04-23  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaenum.vala:
        * vapigen/valagidlparser.vala:
        Add support for delegate_target_pos metadata attribute
index 664ec73..0710b4c 100644 (file)
@@ -30,7 +30,7 @@ public class Vala.CCodeForStatement : CCodeStatement {
        /**
         * The loop condition.
         */
-       public CCodeExpression condition { get; set; }
+       public CCodeExpression? condition { get; set; }
        
        /**
         * The loop body.
@@ -40,9 +40,9 @@ public class Vala.CCodeForStatement : CCodeStatement {
        private Gee.List<CCodeExpression> initializer = new ArrayList<CCodeExpression> ();
        private Gee.List<CCodeExpression> iterator = new ArrayList<CCodeExpression> ();
        
-       public CCodeForStatement (CCodeExpression condition, CCodeStatement? body = null) {
-               this.body = body;
+       public CCodeForStatement (CCodeExpression? condition, CCodeStatement? body = null) {
                this.condition = condition;
+               this.body = body;
        }
 
        /**
index ba035d8..b9979fb 100644 (file)
@@ -69,10 +69,10 @@ public class Vala.ForStatement : CodeNode, Statement {
         * @param source_reference reference to source code
         * @return                 newly created for statement
         */
-       public ForStatement (Expression condition, Block body, SourceReference? source_reference = null) {
+       public ForStatement (Expression? condition, Block body, SourceReference? source_reference = null) {
+               this.condition = condition;
                this.body = body;
                this.source_reference = source_reference;
-               this.condition = condition;
        }
        
        /**