Step -> ControlFlow (use ?)

This commit is contained in:
2026-04-21 09:31:41 +08:00
parent 11b0b8a78e
commit b31c2a4906
11 changed files with 86 additions and 128 deletions
+4 -6
View File
@@ -11,9 +11,7 @@ impl<'gc> crate::Vm<'gc> {
reader: &mut BytecodeReader<'_>,
mc: &Mutation<'gc>,
) -> Step {
if let Some(step) = self.try_force(0, reader, mc) {
return step;
}
self.try_force(0, reader, mc)?;
if self.call_depth > 10000 {
return self.finish_err(Error::eval_error("stack overflow; max-call-depth exceeded"));
}
@@ -41,7 +39,7 @@ impl<'gc> crate::Vm<'gc> {
} else {
todo!("call other types: {func:?}")
}
Step::Continue
Step::Continue(())
}
#[inline(always)]
@@ -109,7 +107,7 @@ impl<'gc> crate::Vm<'gc> {
reader.set_pc(inner_ip);
self.env = inner_env;
self.with_env = inner_with_env;
return Step::Continue;
return Step::Continue(());
}
ThunkState::Evaluated(val) => {
*outer_thunk.borrow_mut(mc) = ThunkState::Evaluated(val);
@@ -132,6 +130,6 @@ impl<'gc> crate::Vm<'gc> {
}
self.env = env;
self.with_env = with_env;
Step::Continue
Step::Continue(())
}
}