mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-31 13:54:27 +01:00
Use read_unaligned with *u8 cast to *u32
Avoids undefined behavior due to unaligned read caught with Miri
This commit is contained in:
@@ -2857,7 +2857,8 @@ impl BTreeCursor {
|
||||
|
||||
// load sibling pages
|
||||
// start loading right page first
|
||||
let mut pgno: u32 = unsafe { right_pointer.cast::<u32>().read().swap_bytes() };
|
||||
let mut pgno: u32 =
|
||||
unsafe { right_pointer.cast::<u32>().read_unaligned().swap_bytes() };
|
||||
let current_sibling = sibling_pointer;
|
||||
let mut group = CompletionGroup::new(|_| {});
|
||||
for i in (0..=current_sibling).rev() {
|
||||
|
||||
Reference in New Issue
Block a user