When using automatic template instantiation with local functions inside the template using the iteration statement, then the process offsets are not correctly computed. E.g. P(2) for P being some processes will not refer to the correct element in the state. Symptoms are wrong results or crashes.
Created attachment 95 [details] Test case
Created attachment 96 [details] Query file
Fixed on the trunk from rev. 1697.