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

Audit for arith_offset intrinsic #1228

Merged
merged 6 commits into from
May 27, 2022

Conversation

adpaco-aws
Copy link
Contributor

@adpaco-aws adpaco-aws commented May 26, 2022

Description of changes:

This PR adds support for the arith_offset intrinsic (used by wrapping_offset) by using the already-implemented codegen_offset function.

The documentation for wrapping_offset defines it as a more permissive version of offset which allows the computed offset to go out-of-bounds. Currently, we don't check in codegen_offset that the computed offset is within bounds to avoid spurious failures, so its definition should work for both.

Resolved issues:

Part of #1163

Call-outs:

Testing:

  • How is this change tested? Adds 6 tests.

  • Is this a refactor change? No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco-aws adpaco-aws requested a review from a team as a code owner May 26, 2022 20:04
Copy link
Contributor

@tedinski tedinski left a comment

Choose a reason for hiding this comment

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

There's a note in your PR description that isn't reflected in the comments of codegen_offset (that these two instrinsics should have different behavior?)

Should there be a tracking issue for this? If so, can you create that and link to it from that function's comments too?

Approving because with that minor change to comments, LGTM

@adpaco-aws adpaco-aws force-pushed the arith-offset-audit branch from 24d5318 to 6524c94 Compare May 27, 2022 19:00
@adpaco-aws
Copy link
Contributor Author

Thanks @tedinski , you're right that we should be tracking this.

I created #1233 and extended the comment to both link that issue and clarify that it's only concerning offset. If we had to add that check at some point, it would be enough to add a flag to check for this property in codegen_offset.

@danielsn danielsn merged commit 64a123d into model-checking:main May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants