-
Notifications
You must be signed in to change notification settings - Fork 356
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
only allow 0-offset on integer pointers #470
Conversation
Integer pointers to non-zsts are normal on embedded. This would make most embedded code UB |
That's platform-specific. On embedded, it might also be okay to do Currently we can only say whether your code is okay on all platforms (of the given target). We cannot test code that makes specific extra assumptions about e.g. allocations existing at fixed locations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite agree, since offsetting integer pointers
- is something you can easily replicate by casting to an int, adding and casting back
- something that you can do without emulating the hardware (writing/reading to/from integer addresses needs such emulation)
That said, there's probably many things that go wrong when looking at embedded. I'll rather address this once I have a basic emulation setup and a bunch of tests
Supporting that is tracked in #224.
We are not talking about hardware though, but about an abstract machine where whether an allocation exists somewhere makes a difference. In that abstract machine, the offset can not be emulated without further knowledge. |
Wow, you have plans there? |
Triggered by rust-lang/rust#54857