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

crucible-jvm: Add permission bit for writability to each static field. #733

Merged
merged 6 commits into from
May 13, 2021

Conversation

brianhuffman
Copy link
Contributor

@brianhuffman brianhuffman commented May 8, 2021

The permission bit is asserted to be true on every putstatic instruction.

This feature will allow SAW to use method specs that do not explicitly
specify a final value for each static field; by making those fields
read-only, we can be sure that the values did not change, without having
to explicitly check that the final value is equal to the initial value.

This will be used to address GaloisInc/saw-script#1066.

The permission bit is asserted to be true on every putstatic instruction.

This feature will allow SAW to use method specs that do not explicitly
specify a final value for each static field; by making those fields
read-only, we can be sure that the values did not change, without having
to explicitly check that the final value is equal to the initial value.
crucible-jvm/src/Lang/Crucible/JVM/Simulate.hs Outdated Show resolved Hide resolved
J.FieldId ->
W4.Pred sym ->
IO (C.SymGlobalState sym)
doStaticFieldWritable sym jc globals fid val =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementations of this function, doStaticFieldStore, and doStaticFieldLoad are nearly identical except for the Just case. Can the common bits be factored out?

crucible-jvm/src/Lang/Crucible/JVM/Simulate.hs Outdated Show resolved Hide resolved
crucible-jvm/src/Lang/Crucible/JVM/Context.hs Outdated Show resolved Hide resolved
@brianhuffman
Copy link
Contributor Author

We've discussed the crux-llvm test failures on macos separately; those are due to an LLVM version issue on the build machines, and are unrelated to this PR.

@brianhuffman brianhuffman merged commit 68eb8b5 into master May 13, 2021
@brianhuffman brianhuffman deleted the jvm-static-field-writable branch May 13, 2021 01:05
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request May 14, 2021
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants