Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

jakebailey opened this issue Aug 5, 2019 · 0 comments


Copy link

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 join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.