Skip to content

Commit bcbf73f

Browse files
authored
Rollup merge of rust-lang#57511 - jethrogb:jb/fix-undef, r=cramertj
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
2 parents 1f66062 + 928efca commit bcbf73f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/sys/sgx/ext/arch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
3636
: "={eax}"(error)
3737
: "{eax}"(ENCLU_EGETKEY),
3838
"{rbx}"(request),
39-
"{rcx}"(out.get_mut())
39+
"{rcx}"(out.as_mut_ptr())
4040
: "flags"
4141
);
4242

@@ -66,7 +66,7 @@ pub fn ereport(
6666
: "{eax}"(ENCLU_EREPORT),
6767
"{rbx}"(targetinfo),
6868
"{rcx}"(reportdata),
69-
"{rdx}"(report.get_mut())
69+
"{rdx}"(report.as_mut_ptr())
7070
);
7171

7272
report.into_inner()

0 commit comments

Comments
 (0)