Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Repeated use of subexpressions can lead to attempted redefinition of constant in C code #880
In generated code (already on the level of "statements", i.e. before we create C++/Cython/... code), repeatedly used subexpressions are not handled correctly.
will lead to a compilation error in weave, because we (correctly) derive that
z = array_...; const double a = z; double x = a; a = z; // <-- not allowed x = a;
I guess this was somewhat of a corner case before (obviously we did not have a test covering this situation), but it gets triggered fairly easy now with the changes I made to synapse generation in #854. In fact, it gets triggered by one of our tutorial examples...
I'll open a PR with the fix in a minute.