-
Notifications
You must be signed in to change notification settings - Fork 353
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
Miri errors when transmuting part of a pointer to an integer #2456
Closed
Labels
Comments
Thanks for the report! The intention is that Miri should not trigger on any of these snippets, they should all be allowed. |
RalfJung
changed the title
Incosistent behavior when transmuting pointers
Miri errors when transmuting part of a pointer to an integer
Aug 2, 2022
RalfJung
added
C-bug
Category: This is a bug.
A-interpreter
Area: affects the core interpreter
labels
Aug 4, 2022
This was referenced Aug 27, 2022
interpret: make read-pointer-as-bytes a CTFE-only error with extra information
rust-lang/rust#101101
Merged
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 30, 2022
…oli-obk interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to rust-lang#99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes rust-lang/miri#2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? `@oli-obk`
bors
added a commit
that referenced
this issue
Aug 31, 2022
Adjust for supporting more implicit ptr-to-int transmutation This is the Miri side of rust-lang/rust#101101. Fixes #2456.
bors
added a commit
that referenced
this issue
Aug 31, 2022
Adjust for supporting more implicit ptr-to-int transmutation This is the Miri side of rust-lang/rust#101101. Fixes #2456.
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this issue
Sep 4, 2022
interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to rust-lang/rust#99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes rust-lang/miri#2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? ``@oli-obk``
antoyo
pushed a commit
to rust-lang/rustc_codegen_gcc
that referenced
this issue
Jun 3, 2023
interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to rust-lang/rust#99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes rust-lang/miri#2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? ``@oli-obk``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
This program triggers Miri:
But these two don’t:
It looks like it should trigger in all of these snippets.
The text was updated successfully, but these errors were encountered: