mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 06:01:33 +00:00
Factor out creating wasmparser::ValidatingParserConfig to its own function.
This commit is contained in:
@ -137,8 +137,22 @@ impl<
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default_validating_parser_config() -> wasmparser::ValidatingParserConfig {
|
||||
wasmparser::ValidatingParserConfig {
|
||||
operator_config: wasmparser::OperatorValidatorConfig {
|
||||
enable_threads: false,
|
||||
enable_reference_types: false,
|
||||
enable_simd: false,
|
||||
enable_bulk_memory: false,
|
||||
enable_multi_value: false,
|
||||
},
|
||||
mutable_global_imports: false,
|
||||
}
|
||||
}
|
||||
|
||||
fn validate(bytes: &[u8]) -> CompileResult<()> {
|
||||
let mut parser = wasmparser::ValidatingParser::new(bytes, None);
|
||||
let mut parser =
|
||||
wasmparser::ValidatingParser::new(bytes, Some(default_validating_parser_config()));
|
||||
loop {
|
||||
let state = parser.read();
|
||||
match *state {
|
||||
|
Reference in New Issue
Block a user