aseba-community/aseba — pull request #270 by vaussard (2013-12-12 10:39:26+00:00)
Title: Fix issue 268

In an assignment, if a lhs also appears as a rhs, no intermediate variable is used when accessing a memory. This can lead to unexpected results, if the rhs references an index already written into the lhs.

To address this issue, we need to use a temporary variable. We hook this into expandVectorialNodes(), as adding a new pass seems unnecessary for now. We detect if the lhs is also part of the rhs (basic check), then create a temporary variable, create a new subtree, then continue the expansion as usual.

Pull request based on the branch release-1.3.x. This can also be merged into master, but a conflict inside tests/CMakeLists.txt will need to be addressed.