mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 23:51:33 +00:00
Return type normalization, and change return errors from imported functions
This commit is contained in:
@ -2,7 +2,7 @@ use crate::syscalls::types::{__wasi_errno_t, __WASI_EFAULT};
|
||||
use std::{cell::Cell, fmt, marker::PhantomData, mem};
|
||||
use wasmer_runtime_core::{
|
||||
memory::Memory,
|
||||
types::{Type, ValueType, WasmExternType},
|
||||
types::{ValueType, WasmExternType},
|
||||
};
|
||||
|
||||
pub struct Array;
|
||||
@ -73,12 +73,12 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
||||
}
|
||||
|
||||
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
|
||||
const TYPE: Type = Type::I32;
|
||||
type Native = i32;
|
||||
|
||||
fn to_bits(self) -> u64 {
|
||||
self.offset as u64
|
||||
fn to_native(self) -> Self::Native {
|
||||
self.offset as i32
|
||||
}
|
||||
fn from_bits(n: u64) -> Self {
|
||||
fn from_native(n: Self::Native) -> Self {
|
||||
Self {
|
||||
offset: n as u32,
|
||||
_phantom: PhantomData,
|
||||
|
Reference in New Issue
Block a user