Skip to content

Commit 9b73dd9

Browse files
Merge pull request #364 from mkroening/unaligned-table-entries
fix: Do unaligned reads for table entries
2 parents 6afeafb + 3bcb979 commit 9b73dd9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ where
191191
if num_entries > 0 {
192192
unsafe {
193193
let entry = if self.rsdt_entry_size == 4 {
194-
*table_entries_ptr.cast::<u32>() as usize
194+
table_entries_ptr.cast::<u32>().read_unaligned() as usize
195195
} else {
196-
*table_entries_ptr.cast::<u64>() as usize
196+
table_entries_ptr.cast::<u64>().read_unaligned() as usize
197197
};
198198
table_entries_ptr = table_entries_ptr.byte_add(self.rsdt_entry_size);
199199
num_entries -= 1;

0 commit comments

Comments
 (0)