mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
fix(interface-types) Instruction::CallCore.function_index
is a u32
.
This commit is contained in:
parent
b63ce1be6c
commit
2074ce8bce
@ -169,7 +169,7 @@ fn instruction<'input, E: ParseError<&'input [u8]>>(
|
||||
(
|
||||
input,
|
||||
Instruction::CallCore {
|
||||
function_index: argument_0 as usize,
|
||||
function_index: argument_0 as u32,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ impl<'a> Parse<'a> for Instruction {
|
||||
parser.parse::<keyword::call_core>()?;
|
||||
|
||||
Ok(Instruction::CallCore {
|
||||
function_index: parser.parse::<u64>()? as usize,
|
||||
function_index: parser.parse::<u32>()?,
|
||||
})
|
||||
} else if lookahead.peek::<keyword::s8_from_i32>() {
|
||||
parser.parse::<keyword::s8_from_i32>()?;
|
||||
|
@ -12,7 +12,7 @@ pub enum Instruction {
|
||||
/// The `call-core` instruction.
|
||||
CallCore {
|
||||
/// The function index.
|
||||
function_index: usize,
|
||||
function_index: u32,
|
||||
},
|
||||
|
||||
/// The `s8.from_i32` instruction.
|
||||
|
@ -8,16 +8,16 @@ use crate::{
|
||||
};
|
||||
|
||||
executable_instruction!(
|
||||
call_core(function_index: usize, instruction: Instruction) -> _ {
|
||||
call_core(function_index: u32, instruction: Instruction) -> _ {
|
||||
move |runtime| -> _ {
|
||||
let instance = &mut runtime.wasm_instance;
|
||||
let index = FunctionIndex::new(function_index);
|
||||
let index = FunctionIndex::new(function_index as usize);
|
||||
|
||||
let local_or_import = instance.local_or_import(index).ok_or_else(|| {
|
||||
InstructionError::new(
|
||||
instruction,
|
||||
InstructionErrorKind::LocalOrImportIsMissing {
|
||||
function_index: function_index as u32,
|
||||
function_index: function_index,
|
||||
},
|
||||
)
|
||||
})?;
|
||||
@ -40,7 +40,7 @@ executable_instruction!(
|
||||
return Err(InstructionError::new(
|
||||
instruction,
|
||||
InstructionErrorKind::LocalOrImportSignatureMismatch {
|
||||
function_index: function_index as u32,
|
||||
function_index: function_index,
|
||||
expected: (local_or_import.inputs().to_vec(), vec![]),
|
||||
received: (input_types, vec![]),
|
||||
},
|
||||
@ -51,7 +51,7 @@ executable_instruction!(
|
||||
InstructionError::new(
|
||||
instruction,
|
||||
InstructionErrorKind::LocalOrImportCall {
|
||||
function_index: function_index as u32,
|
||||
function_index: function_index,
|
||||
},
|
||||
)
|
||||
})?;
|
||||
|
Loading…
Reference in New Issue
Block a user