mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-02 07:51:03 +00:00
fix(interface-types) get-field
#1 argument is of type InterfaceType
.
This commit is contained in:
parent
a7ffffc8b4
commit
4ba9aace64
@ -1,13 +1,12 @@
|
|||||||
use std::str;
|
use std::str;
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Clone, Copy, Debug)]
|
||||||
pub enum InterfaceType {
|
pub enum InterfaceType {
|
||||||
Int,
|
Int,
|
||||||
Float,
|
Float,
|
||||||
Any,
|
Any,
|
||||||
String,
|
String,
|
||||||
Seq,
|
Seq,
|
||||||
|
|
||||||
I32,
|
I32,
|
||||||
I64,
|
I64,
|
||||||
F32,
|
F32,
|
||||||
@ -35,7 +34,7 @@ pub enum Instruction<'input> {
|
|||||||
TableRefGet,
|
TableRefGet,
|
||||||
CallMethod(u64),
|
CallMethod(u64),
|
||||||
MakeRecord(InterfaceType),
|
MakeRecord(InterfaceType),
|
||||||
GetField(u64, u64),
|
GetField(InterfaceType, u64),
|
||||||
Const(InterfaceType, u64),
|
Const(InterfaceType, u64),
|
||||||
FoldSeq(u64),
|
FoldSeq(u64),
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ fn instructions<'input, E: ParseError<&'input [u8]>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
0x0c => {
|
0x0c => {
|
||||||
consume!((input, argument_0) = leb(input)?);
|
consume!((input, argument_0) = ty(input)?);
|
||||||
consume!((input, argument_1) = leb(input)?);
|
consume!((input, argument_1) = leb(input)?);
|
||||||
(input, Instruction::GetField(argument_0, argument_1))
|
(input, Instruction::GetField(argument_0, argument_1))
|
||||||
}
|
}
|
||||||
@ -479,7 +479,7 @@ mod tests {
|
|||||||
0x08, // TableRefGet
|
0x08, // TableRefGet
|
||||||
0x09, 0x01, // CallMethod(1)
|
0x09, 0x01, // CallMethod(1)
|
||||||
0x0a, 0x7f, // MakeRecord(I32)
|
0x0a, 0x7f, // MakeRecord(I32)
|
||||||
0x0c, 0x01, 0x02, // GetField(1, 2)
|
0x0c, 0xff, 0xff, 0x01, 0x02, // GetField(Int, 2)
|
||||||
0x0d, 0x7f, 0x01, // Const(I32, 1)
|
0x0d, 0x7f, 0x01, // Const(I32, 1)
|
||||||
0x0e, 0x01, // FoldSeq(1)
|
0x0e, 0x01, // FoldSeq(1)
|
||||||
0x0a,
|
0x0a,
|
||||||
@ -498,7 +498,7 @@ mod tests {
|
|||||||
Instruction::TableRefGet,
|
Instruction::TableRefGet,
|
||||||
Instruction::CallMethod(1),
|
Instruction::CallMethod(1),
|
||||||
Instruction::MakeRecord(InterfaceType::I32),
|
Instruction::MakeRecord(InterfaceType::I32),
|
||||||
Instruction::GetField(1, 2),
|
Instruction::GetField(InterfaceType::Int, 2),
|
||||||
Instruction::Const(InterfaceType::I32, 1),
|
Instruction::Const(InterfaceType::I32, 1),
|
||||||
Instruction::FoldSeq(1),
|
Instruction::FoldSeq(1),
|
||||||
],
|
],
|
||||||
|
1
lib/interface-types/src/decoders/mod.rs
Normal file
1
lib/interface-types/src/decoders/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub mod binary;
|
Loading…
x
Reference in New Issue
Block a user