From f0fda53cc107ccb581a2493e9f02200413e6055d Mon Sep 17 00:00:00 2001 From: Danek Duvall Date: Tue, 25 Jul 2017 14:32:08 -0700 Subject: [PATCH] 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 --- src/librustc_data_structures/blake2b.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_data_structures/blake2b.rs b/src/librustc_data_structures/blake2b.rs index bdef9fefd41e4..5adeef1ab3a6d 100644 --- a/src/librustc_data_structures/blake2b.rs +++ b/src/librustc_data_structures/blake2b.rs @@ -23,6 +23,7 @@ use std::mem; use std::slice; +#[repr(C)] pub struct Blake2bCtx { b: [u8; 128], h: [u64; 8],