Skip to content

Commit

Permalink
Rollup merge of rust-lang#57511 - jethrogb:jb/fix-undef, r=cramertj
Browse files Browse the repository at this point in the history
Fix undefined behavior

From the [`MaybeUninit::get_mut` docs](https://doc.rust-lang.org/std/mem/union.MaybeUninit.html):
> It is up to the caller to guarantee that the the MaybeUninit really is in an initialized state, otherwise this will immediately cause undefined behavior.

r? @joshtriplett
  • Loading branch information
Centril authored Jan 12, 2019
2 parents 1f66062 + 928efca commit bcbf73f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys/sgx/ext/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
: "={eax}"(error)
: "{eax}"(ENCLU_EGETKEY),
"{rbx}"(request),
"{rcx}"(out.get_mut())
"{rcx}"(out.as_mut_ptr())
: "flags"
);

Expand Down Expand Up @@ -66,7 +66,7 @@ pub fn ereport(
: "{eax}"(ENCLU_EREPORT),
"{rbx}"(targetinfo),
"{rcx}"(reportdata),
"{rdx}"(report.get_mut())
"{rdx}"(report.as_mut_ptr())
);

report.into_inner()
Expand Down

0 comments on commit bcbf73f

Please sign in to comment.