Index: src/SymTab/GenImplicitCall.cpp
===================================================================
--- src/SymTab/GenImplicitCall.cpp	(revision b2ecd4801c2bbbcda494bff1458244b61abd1662)
+++ src/SymTab/GenImplicitCall.cpp	(revision 14c0f7b320884dd43e70581e8f48fa7e2a8bc5c0)
@@ -16,4 +16,5 @@
 #include "GenImplicitCall.hpp"
 
+#include "AST/Copy.hpp"                  // for deepCopy
 #include "AST/Decl.hpp"                  // for ObjectDecl
 #include "AST/Expr.hpp"                  // for ConstantExpr, UntypedExpr,...
@@ -115,8 +116,9 @@
 	std::string cmp, update;
 
+	const ast::Expr * dimension = deepCopy( array->dimension );
 	if ( forward ) {
 		// generate: for ( int i = 0; i < N; ++i )
 		begin = ast::ConstantExpr::from_int( loc, 0 );
-		end = array->dimension;
+		end = dimension;
 		cmp = "?<?";
 		update = "++?";
@@ -124,5 +126,5 @@
 		// generate: for ( int i = N-1; i >= 0; --i )
 		begin = ast::UntypedExpr::createCall( loc, "?-?",
-			{ array->dimension, ast::ConstantExpr::from_int( loc, 1 ) } );
+			{ dimension, ast::ConstantExpr::from_int( loc, 1 ) } );
 		end = ast::ConstantExpr::from_int( loc, 0 );
 		cmp = "?>=?";
