# HG changeset patch
# User Mario de Sousa <msousa@fe.up.pt>
# Date 1335196210 -3600
# Node ID 629105224e57790ef9764ead31043e724a664d4f
# Parent  6510ee2eaab9c47a9ae9125e31320a5b67b946da
Stop lvalue checks after finding an error in the expression.

diff -r 6510ee2eaab9 -r 629105224e57 stage3/lvalue_check.cc
--- a/stage3/lvalue_check.cc	Mon Apr 23 16:44:05 2012 +0100
+++ b/stage3/lvalue_check.cc	Mon Apr 23 16:50:10 2012 +0100
@@ -229,10 +229,11 @@
 
 
 void lvalue_check_c::verify_is_lvalue(symbol_c *lvalue) {
-	check_assignment_to_expression(lvalue);
-	check_assignment_to_controlvar(lvalue);
-	check_assignment_to_output(lvalue);
-	check_assignment_to_constant(lvalue);
+	int init_error_count = error_count;  /* stop the checks once an error has been found... */
+	if (error_count == init_error_count)  check_assignment_to_expression(lvalue);
+	if (error_count == init_error_count)  check_assignment_to_controlvar(lvalue);
+	if (error_count == init_error_count)  check_assignment_to_output(lvalue);
+	if (error_count == init_error_count)  check_assignment_to_constant(lvalue);
 }