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:
@@ -21,8 +21,8 @@ impl UnwindRegistration {
|
||||
/// describe an in-memory representation of a `.eh_frame` section. This is
|
||||
/// typically arranged for by the `wasmtime-obj` crate.
|
||||
pub unsafe fn new(
|
||||
_base_address: *mut u8,
|
||||
unwind_info: *mut u8,
|
||||
_base_address: *const u8,
|
||||
unwind_info: *const u8,
|
||||
unwind_len: usize,
|
||||
) -> Result<UnwindRegistration> {
|
||||
debug_assert_eq!(
|
||||
|
||||
@@ -11,8 +11,8 @@ pub struct UnwindRegistration {
|
||||
|
||||
impl UnwindRegistration {
|
||||
pub unsafe fn new(
|
||||
base_address: *mut u8,
|
||||
unwind_info: *mut u8,
|
||||
base_address: *const u8,
|
||||
unwind_info: *const u8,
|
||||
unwind_len: usize,
|
||||
) -> Result<UnwindRegistration> {
|
||||
assert!(unwind_info as usize % 4 == 0);
|
||||
|
||||
Reference in New Issue
Block a user