Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Don't leave parameters in function's original scope when call evaluation is complete #1407

Open
jakebailey opened this issue Aug 5, 2019 · 0 comments

Comments

@jakebailey
Copy link
Member

jakebailey commented Aug 5, 2019

Part of #1402 masks the fact that when we call a function, we declare parameters inside of the scope of the function (DeclareParametersInScope) before evaluating it, but never "undo" that work. This means that we may leave traces of an old analysis around. This is particularly bad for the builtins module, whose scopes are never cleared.

The way we evaluate functions with parameters should be modified to either:

  • Restore the old parameters or remove the parameters after calling. This will likely need to be locked so two parallel calls to the same function don't cause weirdness.
  • Create a wrapper scope to evaluate the function body in that can be thrown away. This would lack the locking requirement, but many places do casts from IScope to concrete types and would break.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant