Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision ecae5860965de56ce3fadb77f1a7686686e37c67)
+++ src/Parser/ParseNode.h	(revision 2ad4b4971fddd50f53538806f7fcb25b6dad4eb7)
@@ -403,4 +403,5 @@
 };
 
+Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init );
 Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
 Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt );
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision ecae5860965de56ce3fadb77f1a7686686e37c67)
+++ src/Parser/StatementNode.cc	(revision 2ad4b4971fddd50f53538806f7fcb25b6dad4eb7)
@@ -80,19 +80,5 @@
 }
 
-Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) {
-	Statement * thenb, * elseb = 0;
-	std::list< Statement * > branches;
-	buildMoveList< Statement, StatementNode >( then_stmt, branches );
-	assert( branches.size() == 1 );
-	thenb = branches.front();
-
-	if ( else_stmt ) {
-		std::list< Statement * > branches;
-		buildMoveList< Statement, StatementNode >( else_stmt, branches );
-		assert( branches.size() == 1 );
-		elseb = branches.front();
-	} // if
-
-	std::list< Statement * > init;
+Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init ) {
 	if ( ctl->init != 0 ) {
 		buildMoveList( ctl->init, init );
@@ -102,5 +88,5 @@
 	if ( ctl->condition ) {
 		// compare the provided condition against 0
-		cond =  notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) );
+		cond = notZeroExpr( maybeMoveBuild< Expression >(ctl->condition) );
 	} else {
 		for ( Statement * stmt : init ) {
@@ -113,4 +99,23 @@
 	}
 	delete ctl;
+	return cond;
+}
+
+Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt ) {
+	Statement * thenb, * elseb = 0;
+	std::list< Statement * > branches;
+	buildMoveList< Statement, StatementNode >( then_stmt, branches );
+	assert( branches.size() == 1 );
+	thenb = branches.front();
+
+	if ( else_stmt ) {
+		std::list< Statement * > branches;
+		buildMoveList< Statement, StatementNode >( else_stmt, branches );
+		assert( branches.size() == 1 );
+		elseb = branches.front();
+	} // if
+
+	std::list< Statement * > init;
+	Expression * cond = build_if_control( ctl, init );
 	return new IfStmt( cond, thenb, elseb, init );
 }
@@ -144,5 +149,7 @@
 	buildMoveList< Statement, StatementNode >( stmt, branches );
 	assert( branches.size() == 1 );
-	return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), kind );
+
+	std::list< Statement * > init;
+	return new WhileStmt( notZeroExpr( maybeMoveBuild< Expression >(ctl) ), branches.front(), init, kind );
 }
 
