Convert the start function index from a DefinedFuncIndex to a FuncIndex.
This commit is contained in:
@@ -71,7 +71,7 @@ pub struct DummyModuleInfo {
|
||||
pub globals: Vec<Exportable<Global>>,
|
||||
|
||||
/// The start function.
|
||||
pub start_func: Option<DefinedFuncIndex>,
|
||||
pub start_func: Option<FuncIndex>,
|
||||
}
|
||||
|
||||
impl DummyModuleInfo {
|
||||
@@ -418,7 +418,7 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
.push(String::from(name));
|
||||
}
|
||||
|
||||
fn declare_start_func(&mut self, func_index: DefinedFuncIndex) {
|
||||
fn declare_start_func(&mut self, func_index: FuncIndex) {
|
||||
debug_assert!(self.info.start_func.is_none());
|
||||
self.info.start_func = Some(func_index);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use cranelift_codegen::settings::Flags;
|
||||
use std::vec::Vec;
|
||||
use target_lexicon::Triple;
|
||||
use translation_utils::{
|
||||
DefinedFuncIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table, TableIndex,
|
||||
FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table, TableIndex,
|
||||
};
|
||||
use wasmparser::BinaryReaderError;
|
||||
|
||||
@@ -284,7 +284,7 @@ pub trait ModuleEnvironment<'data> {
|
||||
fn declare_global_export(&mut self, global_index: GlobalIndex, name: &'data str);
|
||||
|
||||
/// Declares a start function.
|
||||
fn declare_start_func(&mut self, index: DefinedFuncIndex);
|
||||
fn declare_start_func(&mut self, index: FuncIndex);
|
||||
|
||||
/// Provides the contents of a function body.
|
||||
fn define_function_body(&mut self, body_bytes: &'data [u8]) -> WasmResult<()>;
|
||||
|
||||
Reference in New Issue
Block a user