Skip to content

Commit

Permalink
Constrain the layout of Blake2bCtx for proper SPARC compilation
Browse files Browse the repository at this point in the history
On SPARC, optimization fuel ends up emitting incorrect load and store
instructions for the transmute() call in blake2b_compress().  If we
force Blake2bCtx to be repr(C), the problem disappears.

Fixes #43346
  • Loading branch information
Danek Duvall committed Jul 25, 2017
1 parent c417ee9 commit f0fda53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_data_structures/blake2b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use std::mem;
use std::slice;

#[repr(C)]
pub struct Blake2bCtx {
b: [u8; 128],
h: [u64; 8],
Expand Down

0 comments on commit f0fda53

Please sign in to comment.