Skip to content

Commit

Permalink
[move-vm] Fix a bug in order of bounds checking
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwg committed Oct 1, 2024
1 parent 934daf5 commit 42b12b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions third_party/move/move-binary-format/src/check_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ impl<'a> BoundsChecker<'a> {
self.check_function_instantiations()?;
self.check_field_instantiations()?;
self.check_struct_defs()?;
self.check_function_defs()?;
// Since bytecode version 7
self.check_table(
self.view.variant_field_handles(),
Self::check_variant_field_handle,
Expand All @@ -115,6 +113,7 @@ impl<'a> BoundsChecker<'a> {
self.view.struct_variant_instantiations(),
Self::check_struct_variant_instantiation,
)?;
self.check_function_defs()?;
Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ pub struct DuplicationChecker<'a> {

impl<'a> DuplicationChecker<'a> {
pub fn verify_module(module: &'a CompiledModule) -> VMResult<()> {
let res = Self::verify_module_impl(module)
.map_err(|e| e.finish(Location::Module(module.self_id())));
if let Err(e) = res.clone() {
println!("error: {}", e)
}
res
Self::verify_module_impl(module).map_err(|e| e.finish(Location::Module(module.self_id())))
}

fn verify_module_impl(module: &'a CompiledModule) -> PartialVMResult<()> {
Expand Down

0 comments on commit 42b12b6

Please sign in to comment.