feat(tvix/eval): wrap Closure::upvalues in Rc

See cl/7372; Nix equality semantics require the ability to track
pointer equality of upvalue-sets.

Signed-off-by: Adam Joseph <adam@westernsemico.com>
Change-Id: I82ba517499cf370189a80355e4e46a5caaab7153
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7373
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Adam Joseph 2022-11-24 00:35:33 -08:00 committed by clbot
parent 5eabadf06c
commit 0616976f7c
3 changed files with 11 additions and 6 deletions

View file

@ -694,7 +694,8 @@ impl<'o> VM<'o> {
let mut upvalues = Upvalues::with_capacity(blueprint.upvalue_count);
self.populate_upvalues(upvalue_count, &mut upvalues)?;
self.push(Value::Closure(Closure::new_with_upvalues(
upvalues, blueprint,
Rc::new(upvalues),
blueprint,
)));
}