We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3c9bafa + a5d8f2d commit 3ccc544Copy full SHA for 3ccc544
fuzz/fuzz_targets/chaos.rs
@@ -3,7 +3,7 @@ use arbitrary::Arbitrary;
3
use libfuzzer_sys::fuzz_target;
4
use linked_list_allocator::Heap;
5
use std::alloc::Layout;
6
-use std::ptr::NonNull;
+use std::ptr::{addr_of, NonNull};
7
8
#[derive(Debug, Arbitrary)]
9
enum Action {
@@ -81,8 +81,8 @@ fn fuzz(size: u16, actions: Vec<Action>) {
81
Extend { additional } =>
82
// safety: new heap size never exceeds MAX_HEAP_SIZE
83
unsafe {
84
- let remaining_space = HEAP_MEM
85
- .as_mut_ptr()
+ let remaining_space = addr_of!(HEAP_MEM)
+ .cast::<u8>()
86
.add(MAX_HEAP_SIZE)
87
.offset_from(heap.top());
88
assert!(remaining_space >= 0);
0 commit comments