about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-05T10·20+0300
committertazjin <tazjin@tvl.su>2023-01-06T12·23+0000
commit27fecee1bca2ef92a46912b5787d62d86ce02c45 (patch)
tree08ac1594d25da23d2481ae9fe8489bc1a0cb1e84 /tvix
parent88432235ae34d853f57842a862d7c7ea40793f2d (diff)
fix(tvix/eval): don't increase `with_stack_size` in scope inherits r/5598
There was probably a misunderstanding somewhere about the
with_stack_size being related to how far away it is from the with, but
it is about whether there is a with at all.

This broke a warning (`UselessInherit`), and may actually have let to
more inefficient codegen in some cases.

Change-Id: I08338ea59ae39dad01ca8a4e09d934a936cdea2f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7762
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/compiler/scope.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index 1a89ad6a0649..ef4b4d51e118 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -210,7 +210,7 @@ impl Scope {
         Self {
             poisoned_tokens: self.poisoned_tokens.clone(),
             scope_depth: self.scope_depth + 1,
-            with_stack_size: self.with_stack_size + 1,
+            with_stack_size: self.with_stack_size,
             ..Default::default()
         }
     }