fix: 接通透传闭包值链路

This commit is contained in:
爱特每羊队
2026-06-30 23:57:22 +08:00
parent 855a46efbc
commit a4c13c4f6a
8 changed files with 168 additions and 28 deletions
+4 -2
View File
@@ -226,9 +226,11 @@ impl Vm {
let upvals = obj.upvalues_slice_mut();
if uv_idx < upvals.len() {
if !upvals[uv_idx].is_null() {
unsafe { (*upvals[uv_idx]).value = src_val; }
unsafe {
(*upvals[uv_idx]).value = src_val;
}
vm_debug!("STORE_UPVALUE len={} wrote existing", upvals.len());
} else {
// Lazy create: cell was null (CREATE_CLOSURE before MAKE_CELL)
let cell = self.gc_state.session_epoch.alloc(Cell::new(src_val, true));
upvals[uv_idx] = cell as *mut Cell;
}