Skip to content

Commit

Permalink
Overwrite to None if n=0
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Feb 4, 2025
1 parent 354f2ee commit 43d96c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vm/src/vm/vm_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ impl VirtualMachine {
/// Fetches add_mod & mul_mod builtins according to the optional arguments and executes `fill_memory`
/// Returns an error if either of this optional parameters is true but the corresponding builtin is not present
/// Verifies that both builtin's (if present) batch sizes match the batch_size arg if set
// This method is needed as running `fill_memory` direclty from outside the vm struct would require cloning the builtin runners to avoid double borrowing
// This method is needed as running `fill_memory` directly from outside the vm struct would require cloning the builtin runners to avoid double borrowing
pub fn mod_builtin_fill_memory(
&mut self,
add_mod_ptr_n: Option<(Relocatable, usize)>,
Expand All @@ -1119,6 +1119,9 @@ impl VirtualMachine {
VirtualMachineError,
> {
if let Some((ptr, n)) = mod_params {
if n == 0 {
return Ok(None);
}
let mod_builtin = self
.builtin_runners
.iter()
Expand Down

0 comments on commit 43d96c0

Please sign in to comment.