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

Fix transmute::<T, U> where T requires a bigger alignment than U #33233

Closed
wants to merge 1 commit into from

Commits on Apr 27, 2016

  1. Fix transmute::<T, U> where T requires a bigger alignment than U

    For types that are not bitcast-compatible, transmute tries to avoid
    generating a temporary by translating its source expression directly
    into its destination, but when the source type has a bigger alignment
    requirement than the destination, this can lead to code that breaks due
    to misaligned stores. So in that case we need to generate a temporary
    for the source expression and then copy that into the destination,
    setting the proper alignment information on the memcpy/store.
    
    Fixes rust-lang#32947
    dotdash committed Apr 27, 2016
    Configuration menu
    Copy the full SHA
    ab0de54 View commit details
    Browse the repository at this point in the history