Fix: Clone closure directly for tail calls

This commit is contained in:
Michael Schimmel
2026-02-28 13:13:17 +01:00
parent 7126668934
commit 3daf8ef94d
+1 -1
View File
@@ -511,7 +511,7 @@ impl VM {
let frame = self.frames.last().ok_or("No call frame for 'again'")?;
if let Some(closure) = &frame.closure {
Ok(Value::TailCallRequest(Box::new((
Rc::new(closure.as_ref().clone()) as Rc<dyn Object>,
closure.clone() as Rc<dyn Object>,
arg_vals,
))))
} else {