fix error for functions with VAR_IN_OUT
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 10 Oct 2017 16:38:57 +0300
changeset 1863 46d9955e1101
parent 1862 c4ba411f8c89
child 1864 9e64afb38963
fix error for functions with VAR_IN_OUT

The problem was found by pylint '(used-before-assignment) Using variable "X" before assignment'
PLCGenerator.py
tests/tools/check_source.sh
--- a/PLCGenerator.py	Tue Oct 10 14:01:46 2017 +0300
+++ b/PLCGenerator.py	Tue Oct 10 16:38:57 2017 +0300
@@ -1064,7 +1064,7 @@
                             if parameter in inout_variables:
                                 expression = self.ComputeExpression(body, connections, executionOrderId > 0, True)
                                 if expression is not None:
-                                    inout_variables[parameter] = value
+                                    inout_variables[parameter] = expression
                             else:
                                 expression = self.ComputeExpression(body, connections, executionOrderId > 0)
                             if expression is not None:
--- a/tests/tools/check_source.sh	Tue Oct 10 14:01:46 2017 +0300
+++ b/tests/tools/check_source.sh	Tue Oct 10 16:38:57 2017 +0300
@@ -240,6 +240,7 @@
     enable=$enable,E1305          # (too-many-format-args) Too many arguments for format string
     enable=$enable,E0704          # (misplaced-bare-raise) The raise statement is not inside an except clause
     enable=$enable,C0123          # (unidiomatic-typecheck) Using type() instead of isinstance() for a typecheck.
+    enable=$enable,E0601          # (used-before-assignment)
     # enable=
 
     options=