vala r1307 - in trunk: . ccode vala



Author: juergbi
Date: Wed Apr 23 11:24:24 2008
New Revision: 1307
URL: http://svn.gnome.org/viewvc/vala?rev=1307&view=rev

Log:
2008-04-23  Juerg Billeter  <j bitron ch>

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


Modified:
   trunk/ChangeLog
   trunk/ccode/valaccodeforstatement.vala
   trunk/vala/valaforstatement.vala

Modified: trunk/ccode/valaccodeforstatement.vala
==============================================================================
--- trunk/ccode/valaccodeforstatement.vala	(original)
+++ trunk/ccode/valaccodeforstatement.vala	Wed Apr 23 11:24:24 2008
@@ -30,7 +30,7 @@
 	/**
 	 * The loop condition.
 	 */
-	public CCodeExpression condition { get; set; }
+	public CCodeExpression? condition { get; set; }
 	
 	/**
 	 * The loop body.
@@ -40,9 +40,9 @@
 	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;
 	}
 
 	/**

Modified: trunk/vala/valaforstatement.vala
==============================================================================
--- trunk/vala/valaforstatement.vala	(original)
+++ trunk/vala/valaforstatement.vala	Wed Apr 23 11:24:24 2008
@@ -69,10 +69,10 @@
 	 * @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;
 	}
 	
 	/**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]