minor: fix mutable reference warning in examples (#2631)

This commit is contained in:
Reverier Xu 2024-10-24 18:25:39 +08:00 committed by GitHub
parent dfd5609c10
commit 261b6b5a52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@ use std::{
io::{self, Read, Write}, io::{self, Read, Write},
path::PathBuf, path::PathBuf,
process, process,
ptr::addr_of_mut,
}; };
use clap::{Arg, Command}; use clap::{Arg, Command};
@ -252,7 +253,8 @@ fn fuzz(
// Create an observation channel to keep track of the execution time // Create an observation channel to keep track of the execution time
let time_observer = TimeObserver::new("time"); let time_observer = TimeObserver::new("time");
let func_list = unsafe { OwnedMutPtr::from_raw_mut(Lazy::force_mut(&mut FUNCTION_LIST)) }; let func_list =
unsafe { OwnedMutPtr::from_raw_mut(Lazy::force_mut(&mut *addr_of_mut!(FUNCTION_LIST))) };
let profiling_observer = ProfilingObserver::new("concatenated.json", func_list)?; let profiling_observer = ProfilingObserver::new("concatenated.json", func_list)?;
let callhook = CallHook::new(); let callhook = CallHook::new();