mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-01 09:37:29 +00:00
wasm_interp: don't give Signature the Clone trait just for a test!
This commit is contained in:
parent
8ff843261a
commit
9e7a92574d
2 changed files with 4 additions and 4 deletions
|
@ -615,11 +615,11 @@ fn test_call_indirect_help(table_index: u32, elem_index: u32) -> Value {
|
||||||
let start_fn_name = "test";
|
let start_fn_name = "test";
|
||||||
|
|
||||||
// function 0: caller
|
// function 0: caller
|
||||||
let signature0 = Signature {
|
let signature0 = || Signature {
|
||||||
param_types: bumpalo::vec![in &arena],
|
param_types: bumpalo::vec![in &arena],
|
||||||
ret_type: Some(ValueType::I32),
|
ret_type: Some(ValueType::I32),
|
||||||
};
|
};
|
||||||
create_exported_function_no_locals(&mut module, start_fn_name, signature0.clone(), |buf| {
|
create_exported_function_no_locals(&mut module, start_fn_name, signature0(), |buf| {
|
||||||
buf.append_u8(OpCode::I32CONST as u8);
|
buf.append_u8(OpCode::I32CONST as u8);
|
||||||
buf.encode_u32(elem_index);
|
buf.encode_u32(elem_index);
|
||||||
buf.append_u8(OpCode::CALLINDIRECT as u8);
|
buf.append_u8(OpCode::CALLINDIRECT as u8);
|
||||||
|
@ -629,7 +629,7 @@ fn test_call_indirect_help(table_index: u32, elem_index: u32) -> Value {
|
||||||
});
|
});
|
||||||
|
|
||||||
// function 1: callee, right signature
|
// function 1: callee, right signature
|
||||||
create_exported_function_no_locals(&mut module, "callee1", signature0, |buf| {
|
create_exported_function_no_locals(&mut module, "callee1", signature0(), |buf| {
|
||||||
buf.append_u8(OpCode::I32CONST as u8);
|
buf.append_u8(OpCode::I32CONST as u8);
|
||||||
buf.encode_i32(111);
|
buf.encode_i32(111);
|
||||||
buf.append_u8(OpCode::END as u8);
|
buf.append_u8(OpCode::END as u8);
|
||||||
|
|
|
@ -194,7 +194,7 @@ pub fn update_section_size<T: SerialBuffer>(buffer: &mut T, header_indices: Sect
|
||||||
*
|
*
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Clone)]
|
#[derive(PartialEq, Eq, Debug)]
|
||||||
pub struct Signature<'a> {
|
pub struct Signature<'a> {
|
||||||
pub param_types: Vec<'a, ValueType>,
|
pub param_types: Vec<'a, ValueType>,
|
||||||
pub ret_type: Option<ValueType>,
|
pub ret_type: Option<ValueType>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue