Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 054514d366b6a7a6863d673a9c760baa03661f21)
+++ 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 );
