From e78f8ad37e27e5d13bb4af30f2d7f3bd41e83bb6 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Mon, 15 Apr 2019 19:00:32 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20validate=5Fmodule2=20=E2=86=92=20valid?= =?UTF-8?q?ate=5Fmodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/prepare/mod.rs | 6 ++++-- validation/src/lib.rs | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/prepare/mod.rs b/src/prepare/mod.rs index e5b2b80..cf7531e 100644 --- a/src/prepare/mod.rs +++ b/src/prepare/mod.rs @@ -3,7 +3,7 @@ use alloc::prelude::v1::*; use crate::{ isa, - validation::{validate_module2, Error, Validation}, + validation::{validate_module, Error, Validation}, }; use parity_wasm::elements::Module; @@ -19,6 +19,8 @@ pub struct WasmiValidation { code_map: Vec, } +// This implementation of `Validation` is compiling wasm code at the +// validation time. impl Validation for WasmiValidation { type Output = Vec; type FunctionValidator = compile::Compiler; @@ -38,7 +40,7 @@ impl Validation for WasmiValidation { /// Validate a module and compile it to the internal representation. pub fn compile_module(module: Module) -> Result { - let code_map = validate_module2::(&module)?; + let code_map = validate_module::(&module)?; Ok(CompiledModule { module, code_map }) } diff --git a/validation/src/lib.rs b/validation/src/lib.rs index 292755d..7e0f957 100644 --- a/validation/src/lib.rs +++ b/validation/src/lib.rs @@ -101,8 +101,7 @@ pub trait FunctionValidator { fn finish(self) -> Self::Output; } -// TODO: Rename to validate_module -pub fn validate_module2(module: &Module) -> Result { +pub fn validate_module(module: &Module) -> Result { let mut context_builder = ModuleContextBuilder::new(); let mut imported_globals = Vec::new(); let mut validation = V::new(&module);