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

Ensure that addition and subtraction of addresses panics on overflow/underflow #535

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

farnz
Copy link
Contributor

@farnz farnz commented Feb 11, 2025

Use checked arithmetic for addition and subtraction of VirtAddr and PhysAddr, and add tests to confirm that they do, indeed, panic on arithmetic overflow/underflow.

They already panic on invalid addresses as a result of addition or subtraction, which means that this is hopefully the last piece needed to close #290

Copy link
Member

@Freax13 Freax13 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! :shipit:

@Freax13 Freax13 merged commit be15a1e into rust-osdev:master Feb 11, 2025
10 of 12 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.

Use checked_add in frame_to_pointer
2 participants