Skip to content

Commit

Permalink
Rollup merge of #43480 - dhduvall:sparc-blake2b, r=eddyb
Browse files Browse the repository at this point in the history
Constrain the layout of Blake2bCtx for proper SPARC compilation

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
Mark-Simulacrum authored Jul 26, 2017
2 parents ed09d6d + f0fda53 commit 959ebd6
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 959ebd6

Please sign in to comment.