Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/Common/PassVisitor.impl.h	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -828,6 +828,11 @@
 	VISIT_START( node );
 
-	visitExpression( node->condition );
-	node->body = visitStatement( node->body );
+	{
+		// while statements introduce a level of scope (for the initialization)
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept_impl( node->initialization, *this );
+		visitExpression ( node->condition );
+		node->body = visitStatement( node->body );
+	}
 
 	VISIT_END( node );
@@ -838,6 +843,12 @@
 	MUTATE_START( node );
 
-	node->condition = mutateExpression( node->condition );
-	node->body      = mutateStatement ( node->body      );
+	{
+		// while statements introduce a level of scope (for the initialization)
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutate_impl( node->initialization, *this );
+		node->condition = mutateExpression( node->condition );
+		node->body      = mutateStatement ( node->body      );
+	}
+
 
 	MUTATE_END( Statement, node );
Index: src/ControlStruct/ForExprMutator.cc
===================================================================
--- src/ControlStruct/ForExprMutator.cc	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/ControlStruct/ForExprMutator.cc	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -45,4 +45,7 @@
 		return hoist( forStmt, forStmt->initialization );
 	}
+	Statement *ForExprMutator::postmutate( WhileStmt *whileStmt ) {
+		return hoist( whileStmt, whileStmt->initialization );
+	}
 } // namespace ControlStruct
 
Index: src/ControlStruct/ForExprMutator.h
===================================================================
--- src/ControlStruct/ForExprMutator.h	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/ControlStruct/ForExprMutator.h	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -18,4 +18,5 @@
 class IfStmt;
 class ForStmt;
+class WhileStmt;
 class Statement;
 
@@ -25,4 +26,5 @@
 		Statement *postmutate( IfStmt * );
 		Statement *postmutate( ForStmt * );
+		Statement *postmutate( WhileStmt * );
 	};
 } // namespace ControlStruct
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/Parser/ParseNode.h	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -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 b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/Parser/StatementNode.cc	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -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 );
 }
 
Index: src/SynTree/Statement.cc
===================================================================
--- src/SynTree/Statement.cc	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/SynTree/Statement.cc	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -243,6 +243,6 @@
 }
 
-WhileStmt::WhileStmt( Expression *condition, Statement *body, bool isDoWhile ):
-	Statement(), condition( condition), body( body), isDoWhile( isDoWhile) {
+WhileStmt::WhileStmt( Expression *condition, Statement *body, std::list< Statement * > & initialization, bool isDoWhile ):
+	Statement(), condition( condition), body( body), initialization( initialization ), isDoWhile( isDoWhile) {
 }
 
Index: src/SynTree/Statement.h
===================================================================
--- src/SynTree/Statement.h	(revision b4290263cad50fee2d3f7c383eb46b16863718a5)
+++ src/SynTree/Statement.h	(revision ee3c93d9425378dba13f5e7407f9097ac9d1cbb8)
@@ -220,8 +220,9 @@
 	Expression *condition;
 	Statement *body;
+	std::list<Statement *> initialization;
 	bool isDoWhile;
 
 	WhileStmt( Expression *condition,
-	       Statement *body, bool isDoWhile = false );
+	       Statement *body, std::list<Statement *> & initialization, bool isDoWhile = false );
 	WhileStmt( const WhileStmt &other );
 	virtual ~WhileStmt();
