Skip to content
Commit 1efd61ec authored by Collin Baker's avatar Collin Baker Committed by Chromium LUCI CQ
Browse files

Change UnsafeTrap::arm to mem::MaybeUninit<_> buffer

The UnsafeTrapEvents must be initialized correctly (with the
struct_size field correct) for safety. Taking an initialized buffer in
UnsafeTrap::arm requires either:
* UnsafeTrap::arm to re-initialize the buffer for safety
* UnsafeTrap::arm to be marked unsafe

Neither is desirable. Taking MaybeUninit is in a way even safer, since
it explicitly documents the values are not correctly initialized and
the `UnsafeTrap::arm` implementation must do it.

Bug: 1274864
Change-Id: I0c0c72fc690c3bbd9b0e819aed0ef6941810351a

Cq-Include-Trybots: luci.chromium.try:linux-rust-x64-rel,linux-rust-x64-dbg,android-rust-arm-rel,android-rust-arm-dbg
Change-Id: I0c0c72fc690c3bbd9b0e819aed0ef6941810351a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3627943


Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Collin Baker <collinbaker@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999896}
parent 48cb2d77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment