Skip to content

Commit

Permalink
Made segment finalization happen in empty dicts as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
orizi committed Apr 18, 2024
1 parent a79d32f commit dfe52bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,11 @@ impl Cairo1HintProcessor {
let dict_manager_exec_scope =
exec_scopes.get_mut_ref::<DictManagerExecScope>("dict_manager_exec_scope")?;

// The hint is only for dictionary finalization, so can be called.
let dict_infos_index = dict_manager_exec_scope.get_dict_infos_index(dict_address)?;
vm.insert_value(cell_ref_to_relocatable(dict_index, vm)?, dict_infos_index)
.map_err(HintError::from)
.map_err(HintError::from)?;
// The hint is only for dictionary finalization, so can be called.
dict_manager_exec_scope.finalize_segment(vm, dict_address)
}

#[allow(clippy::too_many_arguments)]
Expand Down Expand Up @@ -949,9 +950,8 @@ impl Cairo1HintProcessor {
HintError::CustomHint("No current key".to_string().into_boxed_str())
})?,
)?;
exec_scopes
.get_mut_ref::<DictManagerExecScope>("dict_manager_exec_scope")?
.finalize_segment(vm, (dict_accesses_address + (n_accesses * 3))?)

Ok(())
}

fn alloc_constant_size(
Expand Down

0 comments on commit dfe52bc

Please sign in to comment.