diff options
author | Vincent Ambo <mail@tazj.in> | 2022-09-22T21·51+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-22T23·23+0000 |
commit | 1015f2f8e7c37c5c4b4ebca799579c5f6c0d5100 (patch) | |
tree | 73ea1853815f8ddf4f720121af70580633833093 /tvix/eval/src/compiler/attrs.rs | |
parent | bd9cda2af7d9fd8064b719e9135b3a48cf13c36a (diff) |
fix(tvix/eval): manually count entries in recursive scopes r/4962
The previous version had a bug where we assumed that the number of entries in an attribute set AST node would be equivalent to the number of entries in the runtime attribute set, but due to inherit nodes containing a variable number of entries, this did not work out. Fixes b/199 Change-Id: I6f7f7729f3512b297cf29a2e046302ca28477854 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6749 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/compiler/attrs.rs')
-rw-r--r-- | tvix/eval/src/compiler/attrs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/compiler/attrs.rs b/tvix/eval/src/compiler/attrs.rs index b4d183c51df8..704bf211ffa7 100644 --- a/tvix/eval/src/compiler/attrs.rs +++ b/tvix/eval/src/compiler/attrs.rs @@ -241,8 +241,8 @@ impl Compiler<'_> { self.scope_mut().begin_scope(); if node.rec_token().is_some() { - self.compile_recursive_scope(slot, true, &node); - self.push_op(OpCode::OpAttrs(Count(node.entries().count())), &node); + let count = self.compile_recursive_scope(slot, true, &node); + self.push_op(OpCode::OpAttrs(Count(count)), &node); } else { let mut count = self.compile_inherit_attrs(slot, node.inherits()); |