From: Juerg Billeter Date: Wed, 23 Apr 2008 11:24:24 +0000 (+0000) Subject: Fix criticals when using for statements without condition X-Git-Tag: VALA_0_3_2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a81a29a26a1bd63bc8c560666453d32d90d42da;p=platform%2Fupstream%2Fvala.git Fix criticals when using for statements without condition 2008-04-23 Juerg Billeter * vala/valaforstatement.vala: * ccode/valaccodeforstatement.vala: Fix criticals when using for statements without condition svn path=/trunk/; revision=1307 --- diff --git a/ChangeLog b/ChangeLog index 32978eb..e61dee7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-04-23 Jürg Billeter + * vala/valaforstatement.vala: + * ccode/valaccodeforstatement.vala: + Fix criticals when using for statements without condition + +2008-04-23 Jürg Billeter + * vala/valaenum.vala: * vapigen/valagidlparser.vala: Add support for delegate_target_pos metadata attribute diff --git a/ccode/valaccodeforstatement.vala b/ccode/valaccodeforstatement.vala index 664ec73..0710b4c 100644 --- a/ccode/valaccodeforstatement.vala +++ b/ccode/valaccodeforstatement.vala @@ -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 initializer = new ArrayList (); private Gee.List iterator = new ArrayList (); - public CCodeForStatement (CCodeExpression condition, CCodeStatement? body = null) { - this.body = body; + public CCodeForStatement (CCodeExpression? condition, CCodeStatement? body = null) { this.condition = condition; + this.body = body; } /** diff --git a/vala/valaforstatement.vala b/vala/valaforstatement.vala index ba035d8..b9979fb 100644 --- a/vala/valaforstatement.vala +++ b/vala/valaforstatement.vala @@ -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; } /**