Skip to content

Fix issue with niches on signed values - #1541

Closed
danielsn wants to merge 2 commits into
model-checking:mainfrom
danielsn:main
Closed

danielsn wants to merge 2 commits into
model-checking:mainfrom
danielsn:main

Conversation

@danielsn

@danielsn danielsn commented Aug 17, 2022 •

Copy link
Copy Markdown
Contributor

Description of changes:

Currently, Kani fails to correctly handle niche optimizations when the underlying data-type is signed.
Use unsigned comparisons (as the rustc backend does) to fix this issue.

Resolved issues:

Resolves #1533

Call-outs:

The niche code is confusing, filed #1540 to track

Testing:

  • How is this change tested? Additional test.

  • 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.

@danielsn
danielsn requested a review from a team as a code owner August 17, 2022 21:20

@celinval celinval left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome! Thanks for doing this.

I just merged #1534 that adds nonzero-fixme.rs. When you merge, you will probably need to remove that. Thanks again!

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.

Niche optimization encoding is broken

2 participants