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

Forbid write and readwrite on pre variable #1

Open
ptal opened this issue Jul 15, 2018 · 1 comment
Open

Forbid write and readwrite on pre variable #1

ptal opened this issue Jul 15, 2018 · 1 comment

Comments

@ptal
Copy link
Owner

ptal commented Jul 15, 2018

For example: pre x.inc() should not be valid because the method inc modifies the variable x.

We chose to specify read/write attributes on the variables because we did not want to impact the Java signature of a method (that might not be inside the current project) or add wrappers around these methods to specify these attributes.
However this static analysis would be more easily done if we have read/write attributes on the methods themselves.
Another possibility is to force the user to write pre read x.inc() although with pre it is already implied.
(Note that it does not solve the problem that the user can lie about the Java signature...).

@ptal ptal changed the title Forbidening write and readwrite on pre variable Forbid write and readwrite on pre variable Jul 16, 2018
@ptal
Copy link
Owner Author

ptal commented Jul 16, 2018

A simpler solution is to forbid calling methods on pre variables. Although it is easy to bypass by wrapping the call in host functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant