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

is_aligned goes wrong on non-provenance pointers with symbolic alignment #2682

Closed
RalfJung opened this issue Nov 20, 2022 · 0 comments · Fixed by #2683
Closed

is_aligned goes wrong on non-provenance pointers with symbolic alignment #2682

RalfJung opened this issue Nov 20, 2022 · 0 comments · Fixed by #2683

Comments

@RalfJung
Copy link
Member

The following should pass even with symbolic alignment checks:

#![feature(strict_provenance, pointer_is_aligned)]

use std::ptr;

fn main() {
    let p = ptr::invalid::<()>(1);
    assert!(p.is_aligned());
}

However, the assertion fails. This is almost certainly caused by rust-lang/rust#102795.

@bors bors closed this as completed in 94ddca1 Nov 20, 2022
RalfJung pushed a commit to RalfJung/rust that referenced this issue Nov 20, 2022
make align_offset always work on no-provenance pointers

Fixes rust-lang/miri#2682
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 a pull request may close this issue.

1 participant