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

analyze: discard rewrites on bounds checking code #1177

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

spernsteiner
Copy link
Collaborator

This branch adds logic for identifying the bounds-checking code that rustc automatically inserts around array and slice accesses and for discarding rewrites that would normally be generated for that code. Trying to rewrite this code is pointless because the code is derived automatically from other parts of the function, and it can trigger errors due to the rewriter not having a distinct place in the source code where it can apply the rewrites.

In the future, we could potentially extend this to skip rewrites on overflow assertions as well.

@spernsteiner spernsteiner requested a review from ahomescu December 2, 2024 21:22
@spernsteiner spernsteiner force-pushed the analyze-ignore-bounds-checks branch from 0729135 to b094dee Compare December 3, 2024 23:24
@spernsteiner spernsteiner force-pushed the analyze-ignore-bounds-checks-base branch from de51ed9 to a96f324 Compare December 3, 2024 23:24
@spernsteiner spernsteiner changed the base branch from analyze-ignore-bounds-checks-base to master December 3, 2024 23:25
@spernsteiner spernsteiner force-pushed the analyze-ignore-bounds-checks branch from b094dee to 6b266a9 Compare December 6, 2024 17:05
@spernsteiner spernsteiner merged commit b069bb6 into master Dec 6, 2024
9 checks passed
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.

2 participants