Use ptr::cast instead of as casts in several places. (#3507)
`ptr::cast` has the advantage of being unable to silently cast `*const T` to `*mut T`. This turned up several places that were performing such casts, which this PR also fixes.
This commit is contained in:
@@ -292,7 +292,7 @@ impl State {
|
||||
let tid = pid; // ThreadId does appear to track underlying thread. Using PID.
|
||||
|
||||
for (idx, func) in module.finished_functions() {
|
||||
let (addr, len) = unsafe { ((*func).as_ptr() as *const u8, (*func).len()) };
|
||||
let (addr, len) = unsafe { ((*func).as_ptr().cast::<u8>(), (*func).len()) };
|
||||
if let Some(img) = &dbg_image {
|
||||
if let Err(err) = self.dump_from_debug_image(img, "wasm", addr, len, pid, tid) {
|
||||
println!(
|
||||
|
||||
Reference in New Issue
Block a user