Let the runtime provide the number of imported functions.

This obviates the need to keep a separate running total of the number of
functions seen.
This commit is contained in:
Dan Gohman
2017-10-09 11:41:01 -07:00
parent e74bc06380
commit 2c9d03f9bd
4 changed files with 10 additions and 5 deletions

View File

@@ -60,7 +60,6 @@ pub fn parse_function_signatures(
pub fn parse_import_section(
parser: &mut Parser,
runtime: &mut WasmRuntime,
function_index: &mut FunctionIndex,
) -> Result<(), SectionParsingError> {
loop {
match *parser.read() {
@@ -70,7 +69,6 @@ pub fn parse_import_section(
field,
} => {
runtime.declare_func_import(sig as SignatureIndex, module, field);
*function_index += 1;
}
ParserState::ImportSectionEntry {
ty: ImportSectionEntryType::Memory(MemoryType { limits: ref memlimits }), ..