Fix cache assignment bug

This commit is contained in:
Alex Shelkovnykov 2023-10-30 12:42:26 +00:00
parent 94246f1b7e
commit 84f9cf9b13
2 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ pub fn jet_ut_crop(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}
@ -61,7 +61,7 @@ pub fn jet_ut_fish(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}
@ -90,7 +90,7 @@ pub fn jet_ut_fuse(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}
@ -112,7 +112,7 @@ pub fn jet_ut_mint(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}
@ -143,7 +143,7 @@ pub fn jet_ut_mull(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}
@ -181,7 +181,7 @@ pub fn jet_ut_nest_dext(context: &mut Context, subject: Noun) -> Result {
if unsafe { pro.raw_equals(YES) && reg.raw_equals(D(0)) }
|| unsafe { pro.raw_equals(NO) && seg.raw_equals(D(0)) }
{
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
}
Ok(pro)
}
@ -211,7 +211,7 @@ pub fn jet_ut_rest(context: &mut Context, subject: Noun) -> Result {
Some(pro) => Ok(pro),
None => {
let pro = interpret(context, subject, slot(subject, 2)?)?;
context.cache.insert(&mut context.stack, &mut key, pro);
context.cache = context.cache.insert(&mut context.stack, &mut key, pro);
Ok(pro)
}
}

View File

@ -38,7 +38,7 @@ impl Context {
// TODO: switch to Pma when ready
// let snap = &mut snapshot::pma::Pma::new(snap_path);
let mut snapshot = DoubleJam::new(snap_path);
let mut stack = NockStack::new(256 << 10 << 10, 0);
let mut stack = NockStack::new(1024 << 10 << 10, 0);
let newt = Newt::new();
let cache = Hamt::<Noun>::new();