Warn when attempting to attach a second continuation onto an existing stack frame, since we don't support that use case.

This commit is contained in:
David Wendt 2019-10-21 18:40:22 -04:00
parent a2ee7f9e3a
commit dd4462c104
1 changed files with 4 additions and 0 deletions

View File

@ -348,6 +348,10 @@ impl<'gc> Activation<'gc> {
/// called in lieu of pushing the return value onto the stack, and may
/// perform any necessary AVM action.
pub fn and_then(&mut self, func: Box<dyn StackContinuation<'gc>>) {
if self.then_func.is_some() {
log::error!("Attaching two continuations to the same stack frame is not supported. The previous continuation will be discarded.");
}
self.then_func = Some(func);
}