Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwg authored Oct 8, 2024
1 parent 18b921d commit b55b1c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions third_party/move/move-model/bytecode/src/astifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
//! the decompilation problem and the solution which is adapted here. The article is a relative
//! light read and hence leaves many details open, which an implementation has to determine.
//!
//! In a nutshell, the decompilation fromm stackless bytecode into the Model AST here
//! In a nutshell, the decompilation from stackless bytecode into the Model AST here
//! works in the steps outlined below
//!
//! # 1. Cleanup
//!
//! The code is cleaned up such that there are no jump proxies if the form `label L; goto L1`.
//! The code is cleaned up such that there are no jump proxies of the form `label L; goto L1`.
//! Also, adjacent sequential blocks are merged, and fallthroughs extended by explicit jumps.
//! It is important for the algorithm to work that all those intermediate blocks are removed
//! and all remaining blocks represent a true branching structure.
Expand All @@ -30,7 +30,7 @@
//! Topological sort the blocks using forward edges only. For those blocks which are not related
//! in the partial order, prioritize that for a branch `if c goto L1 else goto L2`, target
//! blocks follow after the branch. Moreover, for any blocks belonging to a loop, ensure that
//! they are all appear before any blocks which are part of the loop.
//! they all appear before any blocks which are part of the loop.
//!
//! # 4. Raw AST Generation
//!
Expand All @@ -44,7 +44,7 @@
//! ## 4.1 Opening Loops
//!
//! Loops are opened when we either encounter a loop header or a branch. We know what block
//! a loop header is and what are the back edges from (2) above. tIn the case of
//! a loop header is and what are the back edges from (2) above. In the case of
//! branches we need two loops. Consider bytecode for an if-then-else
//!
//! ```ignore
Expand Down
2 changes: 1 addition & 1 deletion third_party/move/move-model/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ impl ExpData {
}

/// Checks for different ways how an unit (void) value is represented. This
/// can be we an empty tuple or an empty sequence.
/// can be an empty tuple or an empty sequence.
pub fn is_unit_exp(&self) -> bool {
matches!(self, ExpData::Sequence(_, stms) if stms.is_empty())
|| matches!(self, ExpData::Call(_, Operation::Tuple, exps) if exps.is_empty())
Expand Down
2 changes: 1 addition & 1 deletion third_party/move/move-model/src/sourcifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ impl<'a> ExpSourcifier<'a> {
lhs.as_ref(),
Call(_, Operation::Select(..) | Operation::SelectVariants(..), _)
) {
// No dref required
// No deref required
self.print_exp(Prio::General, false, lhs);
emit!(self.wr(), " = ");
self.print_exp(Prio::General, false, rhs)
Expand Down

0 comments on commit b55b1c3

Please sign in to comment.