mirror of
https://github.com/fluencelabs/marine.git
synced 2025-06-24 20:21:39 +00:00
Improve arrays and record passing scheme (#76)
This commit is contained in:
@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use crate::IType;
|
||||
use super::WType;
|
||||
use super::WValue;
|
||||
|
||||
use it_lilo::lifter::LiError;
|
||||
use it_lilo::lowerer::LoError;
|
||||
use it_lilo::traits::RecordResolvableError;
|
||||
use thiserror::Error as ThisError;
|
||||
|
||||
#[derive(Debug, ThisError)]
|
||||
@ -34,19 +36,15 @@ pub enum HostImportError {
|
||||
#[error("Not enough WValue arguments are provided from the Wasm side")]
|
||||
MismatchWValuesCount,
|
||||
|
||||
/// An error related to invalid memory access during lifting IValue.
|
||||
#[error("Invalid memory access while lifting IValues, offset {0}, size {1}")]
|
||||
InvalidMemoryAccess(i32, i32),
|
||||
#[error("{0}")]
|
||||
LifterError(#[from] LiError),
|
||||
|
||||
/// An error related to lifting memory from arrays of pointers with odd elements count.
|
||||
#[error("Arrays of pointers for value type {0:?} contains non-even count of elements")]
|
||||
OddPointersCount(IType),
|
||||
#[error("{0}")]
|
||||
LowererError(#[from] LoError),
|
||||
|
||||
/// An error related to not found record in module record types.
|
||||
#[error("Record with type id {0} not found")]
|
||||
RecordTypeNotFound(u64),
|
||||
#[error("{0}")]
|
||||
RecordNotFound(#[from] RecordResolvableError),
|
||||
|
||||
/// An error encountered while transmiting arrays.
|
||||
#[error("array of bytes with len {0} can't be transmuted to {1} type")]
|
||||
TransmuteArrayError(usize, &'static str),
|
||||
#[error("{0}")]
|
||||
InvalidUTF8String(#[from] std::string::FromUtf8Error),
|
||||
}
|
||||
|
Reference in New Issue
Block a user