From ee53108d3a9e1e5bf6e71e30d2cd54fb35c7fe27 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 15 Dec 2022 22:33:11 +0800 Subject: [PATCH] Fixes Miri faults. --- src/func/call.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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};