Skip to content

Commit

Permalink
fix(scripts/spawn): always consume extra_cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson authored and zhangsoledad committed Sep 1, 2023
1 parent 2ee232c commit cca4904
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script/src/syscalls/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ where
.add_cycles_no_checking(transferred_byte_cycles(size))?;
}
Err(_) => {
// If loading binary fails, we still need to consume extra_cycles.
machine.add_cycles_no_checking(extra_cycles)?;
machine.set_register(A0, Mac::REG::from_u8(WRONG_FORMAT));
return Ok(true);
}
Expand Down

0 comments on commit cca4904

Please sign in to comment.