From b2fcb1ad177fb5a467f9b9355af6ad798328dd93 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 29 Aug 2017 06:21:28 -0700 Subject: [PATCH] Change translate_module to use a slice rather than a borrowed Vec. This makes it more convenient to call from a cargo-fuzz fuzzer. --- lib/wasm/src/module_translator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index 11acbb1b4a..99071b1bc8 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -58,10 +58,10 @@ impl ImportMappings { /// [`Function`](../cretonne/ir/function/struct.Function.html). /// Returns the functions and also the mappings for imported functions and signature between the /// indexes in the wasm module and the indexes inside each functions. -pub fn translate_module(data: &Vec, +pub fn translate_module(data: &[u8], runtime: &mut WasmRuntime) -> Result { - let mut parser = Parser::new(data.as_slice()); + let mut parser = Parser::new(data); match *parser.read() { ParserState::BeginWasm { .. } => {} ParserState::Error(BinaryReaderError { message, offset }) => {