-
Notifications
You must be signed in to change notification settings - Fork 340
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
Make pointer::align_offset exploit allocation alignment #873
Comments
One potential complication here is that this might make code run SSE where it did not before, because the aligned part is using SSE instructions. We should add test cases at least for libstd uses for |
Also see rust-lang/rust#62420 for a detailed discussion about the benefits of making align_offset fail even though it could succeed. |
Use libcore's align_offset Related issue: #873
I think this was solved (at least partially) by #945 |
Yes this is solved; the only thing that's missing is adding the testcase to our test suite. :) |
Miri's implementation of
align_offset
currently always says "nope, can't do that". We could do better than that in case the alignment of the allocation of the argument pointer is at least the requested alignment. In that case, we can basically run the real implementation ofalign_offset
from libcore.Testcase by @shepmaster:
There should also be another testcase where the modulo stuff becomes more interesting (
align_offset
returns an offset in units ofsize_of::<T>()
, not bytes).The text was updated successfully, but these errors were encountered: