Do lvalue check of function output parameters (since they may contain expressions inside array subscripts!)
authormjsousa
Thu, 15 Aug 2013 11:24:54 +0100
changeset 831 691e1cc38d3a
parent 830 6f45ec6ed011
child 832 8cd104e483c6
Do lvalue check of function output parameters (since they may contain expressions inside array subscripts!)
stage3/lvalue_check.cc
--- a/stage3/lvalue_check.cc	Sat Aug 10 09:10:06 2013 +0100
+++ b/stage3/lvalue_check.cc	Thu Aug 15 11:24:54 2013 +0100
@@ -292,9 +292,9 @@
 			/* If the parameter is either OUT or IN_OUT, we check if 'call_param_value' is a valid lvalue */
 			if ((function_param_iterator_c::direction_out == param_direction) || (function_param_iterator_c::direction_inout == param_direction)) 
 				verify_is_lvalue(call_param_value);
-			/* parameter values to IN parameters may be expressions with function invocations that must also be checked! */
-			if (function_param_iterator_c::direction_in == param_direction) 
-				call_param_value->accept(*this);  
+			/* parameter values to IN  parameters may be expressions with function invocations that must also be checked! */
+			/* parameter values to OUT or IN_OUT parameters may contain arrays, whose subscripts contain expressions that must be checked! */
+			call_param_value->accept(*this);  
 		}
 	}
 }
@@ -332,10 +332,9 @@
 			/* If the parameter is either OUT or IN_OUT, we check if 'call_param_value' is a valid lvalue */
 			if ((function_param_iterator_c::direction_out == param_direction) || (function_param_iterator_c::direction_inout == param_direction)) 
 				verify_is_lvalue(call_param_value);
-			/* parameter values to IN parameters may be expressions with function invocations that must also be checked! */
-			if (function_param_iterator_c::direction_in == param_direction) 
-				call_param_value->accept(*this);  
-		
+			/* parameter values to IN  parameters may be expressions with function invocations that must also be checked! */
+			/* parameter values to OUT or IN_OUT parameters may contain arrays, whose subscripts contain expressions that must be checked! */
+			call_param_value->accept(*this);  
  		}
 	}
 }