Uh oh!
There was an error while loading. Please reload this page.
Set proper alignment on constants - #28920
Conversation
rust-highfive
commented
Oct 8, 2015
(rust_highfive has picked a reviewer for you, use r? to override) |
eddyb
commented
Oct 8, 2015
r=me with the formatting nit fixed. |
dotdash
commented
Oct 8, 2015
@bors r=eddyb 00a79c0 |
There was a problem hiding this comment.
I think this belongs inside addr_of_mut, rather than here.
dotdash
commented
Oct 8, 2015
@bors r- @eefriedman Good point. |
dotdash
commented
Oct 9, 2015
Update as per the suggestion of @eefriedman. I also had to fix the string that identifies the gdb script section, which is used as a C string but had no terminating 0 byte. The alignment changes caused that bug to trigger an error in a codegen test. |
alexcrichton
commented
Oct 9, 2015
r? @eddyb |
There was a problem hiding this comment.
For clarity, you might want to use c_section_var_name.as_ptr() as *const _ below.
There was a problem hiding this comment.
For correctness even. Not sure where I lost that change (and even more confusing that it passed the test without it). Thanks!
For enum variants, the default alignment for a specific variant might be lower than the alignment of the enum type itself. In such cases we, for example, generate memcpy calls with an alignment that's higher than the alignment of the constant we copy from. To avoid that, we need to explicitly set the required alignment on constants. Fixesrust-lang#28912.
dotdash
commented
Oct 9, 2015
Updated to handle upgrading the alignment of constants that are shared between types with different alignment requirements. Thanks a lot @eefriedman! |
eddyb
commented
Oct 10, 2015
@bors r+ |
bors
commented
Oct 10, 2015
📌 Commit 6ad079e has been approved by |
bors
commented
Oct 10, 2015
For enum variants, the default alignment for a specific variant might be lower than the alignment of the enum type itself. In such cases we, for example, generate memcpy calls with an alignment that's higher than the alignment of the constant we copy from. To avoid that, we need to explicitly set the required alignment on constants. Fixes#28912.
For enum variants, the default alignment for a specific variant might be
lower than the alignment of the enum type itself. In such cases we, for
example, generate memcpy calls with an alignment that's higher than the
alignment of the constant we copy from.
To avoid that, we need to explicitly set the required alignment on
constants.
Fixes#28912.