Skip to content

Commit

Permalink
Merge pull request #4127 from libraries/fix-spawn-cycles
Browse files Browse the repository at this point in the history
fix(scripts/spawn): always consume extra_cycles
  • Loading branch information
zhangsoledad authored Aug 31, 2023
2 parents 9cf92d8 + 716e1b2 commit 97e2cbf
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 97e2cbf

Please sign in to comment.