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:
@@ -346,7 +346,7 @@ impl Global {
|
||||
Val::F64(f) => *definition.as_u64_mut() = f,
|
||||
Val::FuncRef(f) => {
|
||||
*definition.as_anyfunc_mut() = f.map_or(ptr::null(), |f| {
|
||||
f.caller_checked_anyfunc(store).as_ptr() as *const _
|
||||
f.caller_checked_anyfunc(store).as_ptr().cast()
|
||||
});
|
||||
}
|
||||
Val::ExternRef(x) => {
|
||||
|
||||
Reference in New Issue
Block a user