Add verify_is_lvalue to control_variable in for_statement.
authorManuele Conti <conti.ma@alice.it>
Sun, 13 May 2012 17:57:15 +0200
changeset 557 95a2fe60a15c
parent 556 af3e378e98f9
child 558 9273dfc5fa7c
Add verify_is_lvalue to control_variable in for_statement.
stage3/lvalue_check.cc
--- a/stage3/lvalue_check.cc	Thu May 10 22:03:59 2012 +0100
+++ b/stage3/lvalue_check.cc	Sun May 13 17:57:15 2012 +0200
@@ -535,6 +535,7 @@
 /* B 3.2.4 Iteration Statements */
 /********************************/
 void *lvalue_check_c::visit(for_statement_c *symbol) {
+        verify_is_lvalue(symbol->control_variable);
 	control_variables.push_back(get_var_name_c::get_name(symbol->control_variable));
 	symbol->statement_list->accept(*this);
 	control_variables.pop_back();