diff --git a/lib/wasm/src/environ/dummy.rs b/lib/wasm/src/environ/dummy.rs index 290aa38c0..5bf196168 100644 --- a/lib/wasm/src/environ/dummy.rs +++ b/lib/wasm/src/environ/dummy.rs @@ -402,7 +402,7 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment { _table_index: TableIndex, _base: Option, _offset: usize, - _elements: Vec, + _elements: Box<[FuncIndex]>, ) { // We do nothing } diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 37d741a4f..92c7fa9e2 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -14,8 +14,8 @@ use cranelift_codegen::ir::immediates::Offset32; use cranelift_codegen::ir::{self, InstBuilder}; use cranelift_codegen::isa::TargetFrontendConfig; use failure_derive::Fail; +use std::boxed::Box; use std::convert::From; -use std::vec::Vec; use wasmparser::BinaryReaderError; /// The value of a WebAssembly global variable. @@ -336,7 +336,7 @@ pub trait ModuleEnvironment<'data> { table_index: TableIndex, base: Option, offset: usize, - elements: Vec, + elements: Box<[FuncIndex]>, ); /// Provides the contents of a function body. diff --git a/lib/wasm/src/sections_translator.rs b/lib/wasm/src/sections_translator.rs index 89c1750c8..6192ec7b0 100644 --- a/lib/wasm/src/sections_translator.rs +++ b/lib/wasm/src/sections_translator.rs @@ -253,7 +253,12 @@ pub fn parse_element_section<'data>( let x = item?; elems.push(FuncIndex::from_u32(x)); } - environ.declare_table_elements(TableIndex::from_u32(table_index), base, offset, elems) + environ.declare_table_elements( + TableIndex::from_u32(table_index), + base, + offset, + elems.into_boxed_slice(), + ) } Ok(()) }