-
Notifications
You must be signed in to change notification settings - Fork 25
Description
In the STL discrete-time offline AstVisitor some of the visit functions manipulate the variable returned by the recursive call to self.visit(node.children[0], *args, **kwargs) (most times called sample). However, this is the very same variable that was stored in the result field of the ast at line 14. Therefore, the changes performed in the visit functions will cause side-effects in the ast.result dictionary.
In visitVariable even the input traces are directly returned and might be changed by other functions.
Solution is either to change the visit function at line14 to store a copy of the variables in ast.results or to avoid all changes to the sample variable in the various visit functions. Probably best to do both?
I have not checked if other interpreters have the same issue.