We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 322fa3e commit f76989bCopy full SHA for f76989b
uefi/src/util.rs
@@ -5,8 +5,10 @@ use core::ptr::{self, NonNull};
5
/// Copy the bytes of `val` to `ptr`, then advance pointer to just after the
6
/// newly-copied bytes.
7
pub unsafe fn ptr_write_unaligned_and_add<T>(ptr: &mut *mut u8, val: T) {
8
- ptr.cast::<T>().write_unaligned(val);
9
- *ptr = ptr.add(size_of::<T>());
+ unsafe {
+ ptr.cast::<T>().write_unaligned(val);
10
+ *ptr = ptr.add(size_of::<T>());
11
+ }
12
}
13
14
/// Convert from a `u32` to a `usize`. Panic if the input does fit. On typical
0 commit comments