From 2a0e02aec4f1d7c6e00f020046b0f01bf242e968 Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Fri, 29 Sep 2023 17:25:54 -0500 Subject: [PATCH] :white_check_mark: test: closure passing again, fma still not --- src/state.rs | 2 +- src/value.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index a334f4a..3132012 100644 --- a/src/state.rs +++ b/src/state.rs @@ -249,7 +249,7 @@ impl <'a> State <'a> { Instruction::Closure (a, b) => { let b = usize::try_from (*b).unwrap (); - let idx = b + 1; + let idx = frame.block_idx + b + 1; let block = &chunk.blocks [idx]; let mut new_upvalues = Vec::with_capacity (block.upvalues.len ()); diff --git a/src/value.rs b/src/value.rs index b8257f2..c0ff740 100644 --- a/src/value.rs +++ b/src/value.rs @@ -11,6 +11,7 @@ use std::{ #[derive (Debug, Eq, PartialEq)] pub struct BogusClosure { + // I'm pretty sure this should be absolute? pub idx: usize, pub upvalues: Vec , }