tool: fix memory ranges overlapping checks#429
Merged
Ivan-Velickovic merged 1 commit intoseL4:mainfrom Mar 10, 2026
Merged
Conversation
midnightveil
suggested changes
Mar 9, 2026
tool/microkit/src/util.rs
Outdated
| } | ||
|
|
||
| /// Returns true if two ranges overlap. | ||
| /// Returns true if two inclusive ranges overlap. |
Contributor
There was a problem hiding this comment.
given that al of the usercases of this function give it exclusive ranges... maybe this should be changed?
or do we always tend to use inclusive ranges
Contributor
Author
There was a problem hiding this comment.
That's reasonable, I will change it like you suggested
Previously, ranges_overlap() returns true if two inclusive ranges overlap. But builder.rs was passing half-open ranges which caused the tool to report that two memory regions are overlapping when in reality they were not. This commit changed ranges_overlap() to work on half-open ranges instead Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
9d9b7f8 to
21d092f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
ranges_overlap()inutil.rsreturns true if two inclusive ranges overlap. Butbuilder.rswas passing half-open ranges which caused the tool to report that two memory regions are overlapping when in reality they were not.This PR changed ranges_overlap() to work on half-open ranges instead.
An example that replicated the bug: