diff --git a/src/func/call.rs b/src/func/call.rs index 4f68b776..f64e7dfa 100644 --- a/src/func/call.rs +++ b/src/func/call.rs @@ -386,7 +386,6 @@ impl Engine { // Clone the first argument backup.change_first_arg_to_copy(args); } - auto_restore!(args if swap => move |a| backup.restore_first_arg(a)); #[cfg(feature = "debugging")] if self.is_debugger_registered() { @@ -424,6 +423,10 @@ impl Engine { .and_then(|r| self.check_data_size(r, pos)) .map_err(|err| err.fill_position(pos)); + if swap { + backup.restore_first_arg(args); + } + #[cfg(feature = "debugging")] if self.is_debugger_registered() { use crate::eval::{DebuggerEvent, DebuggerStatus};