Use pointer::add instead of pointer::offset with a cast.
This commit is contained in:
@@ -460,13 +460,13 @@ pub unsafe extern "C" fn wasm_func_call(
|
||||
let func = (*func).func.borrow();
|
||||
let mut params = Vec::with_capacity(func.param_arity());
|
||||
for i in 0..func.param_arity() {
|
||||
let val = &(*args.offset(i as isize));
|
||||
let val = &(*args.add(i));
|
||||
params.push(val.val());
|
||||
}
|
||||
match func.call(¶ms) {
|
||||
Ok(out) => {
|
||||
for i in 0..func.result_arity() {
|
||||
let val = &mut (*results.offset(i as isize));
|
||||
let val = &mut (*results.add(i));
|
||||
*val = wasm_val_t::from_val(&out[i]);
|
||||
}
|
||||
ptr::null_mut()
|
||||
@@ -666,7 +666,7 @@ pub unsafe extern "C" fn wasm_instance_new(
|
||||
let store = &(*store).store;
|
||||
let mut externs: Vec<Extern> = Vec::with_capacity((*module).imports.len());
|
||||
for i in 0..(*module).imports.len() {
|
||||
let import = *imports.offset(i as isize);
|
||||
let import = *imports.add(i);
|
||||
externs.push((*import).ext.clone());
|
||||
}
|
||||
let module = &(*module).module;
|
||||
|
||||
Reference in New Issue
Block a user