Skip to content

Commit

Permalink
Add a debug_assert_eq to check extra_cycles is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Apr 25, 2024
1 parent e190794 commit 3c45fc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ where
.ok_or(Error::CyclesOverflow)?;
Ok(consumed_cycles + self.extra_cycles)
}
Err(e) => Err(e),
Err(e) => {
// In this case, there should be no vm instantiated/uninstantiated state switch.
debug_assert_eq!(self.extra_cycles, 0);
Err(e)
}
}
}

Expand Down

0 comments on commit 3c45fc4

Please sign in to comment.