Change translate_module to use a slice rather than a borrowed Vec.
This makes it more convenient to call from a cargo-fuzz fuzzer.
This commit is contained in:
@@ -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<u8>,
|
||||
pub fn translate_module(data: &[u8],
|
||||
runtime: &mut WasmRuntime)
|
||||
-> Result<TranslationResult, String> {
|
||||
let mut parser = Parser::new(data.as_slice());
|
||||
let mut parser = Parser::new(data);
|
||||
match *parser.read() {
|
||||
ParserState::BeginWasm { .. } => {}
|
||||
ParserState::Error(BinaryReaderError { message, offset }) => {
|
||||
|
||||
Reference in New Issue
Block a user