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:
@@ -130,7 +130,7 @@ impl State {
|
||||
.unwrap_or_else(|| format!("wasm_module_{}", global_module_id));
|
||||
|
||||
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()) };
|
||||
let method_name = super::debug_name(module.module(), idx);
|
||||
let method_id = self.get_method_id();
|
||||
log::trace!(
|
||||
|
||||
Reference in New Issue
Block a user