From 59f9acc4776c09a35c6d563609de6818e9b65084 Mon Sep 17 00:00:00 2001 From: shuoer86 <129674997+shuoer86@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:18:33 +0800 Subject: [PATCH] Fix typos (#899) --- crates/wasmi/src/engine/translator/mod.rs | 18 +++++++++--------- crates/wasmi/src/engine/translator/visit.rs | 4 ++-- fuzz/fuzz_targets/differential.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/wasmi/src/engine/translator/mod.rs b/crates/wasmi/src/engine/translator/mod.rs index b20a4fa5ac..3c336f1123 100644 --- a/crates/wasmi/src/engine/translator/mod.rs +++ b/crates/wasmi/src/engine/translator/mod.rs @@ -1130,7 +1130,7 @@ impl FuncTranslator { /// /// # Note /// - /// - Returns `Ok(true)` is the optmization was applied. + /// - Returns `Ok(true)` is the optimization was applied. /// - Returns `Ok(false)` is the optimization could not be applied. /// - Returns `Err(_)` if a translation error occurred. fn try_push_binary_instr_imm16( @@ -1242,9 +1242,9 @@ impl FuncTranslator { /// /// - The `make_instr_opt` closure allows to implement custom optimization /// logic for the case that both operands are registers. - /// - The `make_instr_reg_imm_opt` closure allows to implement custom optmization + /// - The `make_instr_reg_imm_opt` closure allows to implement custom optimization /// logic for the case that the right-hand side operand is a constant value. - /// - The `make_instr_imm_reg_opt` closure allows to implement custom optmization + /// - The `make_instr_imm_reg_opt` closure allows to implement custom optimization /// logic for the case that the left-hand side operand is a constant value. /// /// # Usage @@ -1314,9 +1314,9 @@ impl FuncTranslator { /// /// - The `make_instr_opt` closure allows to implement custom optimization /// logic for the case that both operands are registers. - /// - The `make_instr_reg_imm_opt` closure allows to implement custom optmization + /// - The `make_instr_reg_imm_opt` closure allows to implement custom optimization /// logic for the case that the right-hand side operand is a constant value. - /// - The `make_instr_imm_reg_opt` closure allows to implement custom optmization + /// - The `make_instr_imm_reg_opt` closure allows to implement custom optimization /// logic for the case that the left-hand side operand is a constant value. /// /// # Usage @@ -1428,7 +1428,7 @@ impl FuncTranslator { /// /// - The `make_instr_opt` closure allows to implement custom optimization /// logic for the case that both operands are registers. - /// - The `make_instr_imm_opt` closure allows to implement custom optmization + /// - The `make_instr_imm_opt` closure allows to implement custom optimization /// logic for the case that one of the operands is a constant value. /// /// # Usage @@ -1486,7 +1486,7 @@ impl FuncTranslator { /// /// - The `make_instr_opt` closure allows to implement custom optimization /// logic for the case that both operands are registers. - /// - The `make_instr_imm_opt` closure allows to implement custom optmization + /// - The `make_instr_imm_opt` closure allows to implement custom optimization /// logic for the case that one of the operands is a constant value. /// /// # Usage @@ -1541,7 +1541,7 @@ impl FuncTranslator { /// - Its various function arguments allow it to be used for generic Wasm types. /// - Applies constant evaluation if both operands are constant values. /// - /// - The `make_instr_imm_reg_opt` closure allows to implement custom optmization + /// - The `make_instr_imm_reg_opt` closure allows to implement custom optimization /// logic for the case the shifted value operand is a constant value. /// /// # Usage @@ -1611,7 +1611,7 @@ impl FuncTranslator { /// - Its various function arguments allow it to be used for `i32` and `i64` types. /// - Applies constant evaluation if both operands are constant values. /// - /// - The `make_instr_reg_imm_opt` closure allows to implement custom optmization + /// - The `make_instr_reg_imm_opt` closure allows to implement custom optimization /// logic for the case the right-hand side operand is a constant value. /// /// # Usage diff --git a/crates/wasmi/src/engine/translator/visit.rs b/crates/wasmi/src/engine/translator/visit.rs index d4755d359c..56ef204f71 100644 --- a/crates/wasmi/src/engine/translator/visit.rs +++ b/crates/wasmi/src/engine/translator/visit.rs @@ -852,8 +852,8 @@ impl<'a> VisitOperator<'a> for FuncTranslator { let content = global_type.content(); if let (Mutability::Const, Some(init_expr)) = (global_type.mutability(), init_value) { if let Some(value) = init_expr.eval_const() { - // Optmization: Access to immutable internally defined global variables - // can be replaced with their constant initialization value. + // Optimization: Access to immutable internally defined global variables + // can be replaced with their constant initialization value. self.alloc.stack.push_const(TypedValue::new(content, value)); self.alloc.instr_encoder.reset_last_instr(); return Ok(()); diff --git a/fuzz/fuzz_targets/differential.rs b/fuzz/fuzz_targets/differential.rs index 4e59f40bff..72d7e8e835 100644 --- a/fuzz/fuzz_targets/differential.rs +++ b/fuzz/fuzz_targets/differential.rs @@ -283,7 +283,7 @@ impl DifferentialTarget for Wasmtime { use wasmtime::{Config, Engine, Linker, Module, Store, StoreLimitsBuilder}; let mut config = Config::default(); // We disabled backtraces since they sometimes become so large - // that the entire output is obliberated by them. Generally we are + // that the entire output is obliterated by them. Generally we are // more interested what kind of error occurred and now how an error // occurred. config.wasm_backtrace(false);