From 445d0cd3c656b217298de629976fe3260238ce31 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Mon, 9 Jul 2018 19:35:13 +0800 Subject: [PATCH] Add comments why assert is always true --- src/runner.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runner.rs b/src/runner.rs index 941cea2..2b7d92e 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -106,7 +106,7 @@ impl Interpreter { } pub fn start_execution<'a, E: Externals + 'a>(&mut self, externals: &'a mut E) -> Result, Trap> { - // Ensure that the VM has not been executed. + // Ensure that the VM has not been executed. This is checked in `FuncInvocation::start_execution`. assert!(self.state == InterpreterState::Initialized); self.state = InterpreterState::Started; @@ -125,7 +125,7 @@ impl Interpreter { pub fn resume_execution<'a, E: Externals + 'a>(&mut self, return_val: Option, externals: &'a mut E) -> Result, Trap> { use std::mem::swap; - // Ensure that the VM is resumable. + // Ensure that the VM is resumable. This is checked in `FuncInvocation::resume_execution`. assert!(self.state.is_resumable()); let mut resumable_state = InterpreterState::Started;