From 68a4d4a759f4e71832d99db15ceccc992b1fa0dd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 29 Sep 2022 23:02:41 +0300 Subject: fix(tvix/eval): fix thunk borrowing error in force_for_output This function previously kept a borrow in the form of the `Thunk::value` result alive while performing arbitrary actions in the VM, which caused a borrowing error in the test case attached. The `Ref` value must never be used in cases where control flow is passed to other parts of the VM. Change-Id: I41d10aa1882a2166614b670e8ba77aab0e67deca Reviewed-on: https://cl.tvl.fyi/c/depot/+/6825 Reviewed-by: grfn Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp new file mode 100644 index 000000000000..a1dca9bb6860 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp @@ -0,0 +1 @@ +{ a = { b = 1; c = 2; }; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix new file mode 100644 index 000000000000..7d037c6b37bc --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix @@ -0,0 +1,4 @@ +rec { + a.b = 1; + a.c = a.b * 2; +} -- cgit 1.4.1