about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-11T12·00+0300
committertazjin <tazjin@tvl.su>2022-09-11T12·26+0000
commit677d4e6881f4d97b4b491fc7277bd49efba4a693 (patch)
tree6481f95b7ed19099e8eb9d154430aa215a06d900 /tvix/eval
parent675bd36ea52feaed945e2fb39aff79c16d575468 (diff)
fix(tvix/eval): reduce scope depth in scope module r/4813
Change-Id: If32f9e4c9212f20a39baa15d479ff1387c17570d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6500
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/compiler/mod.rs2
-rw-r--r--tvix/eval/src/compiler/scope.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 7ee262cad008..3e8a6aefd792 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -1067,8 +1067,6 @@ impl Compiler<'_, '_> {
         if popcount > 0 {
             self.push_op(OpCode::OpCloseScope(Count(popcount)), node);
         }
-
-        self.scope_mut().scope_depth -= 1;
     }
 
     /// Open a new lambda context within which to compile a function,
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index e69922a33013..1909a8dc8a76 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -310,6 +310,8 @@ impl Scope {
             }
         }
 
+        self.scope_depth -= 1;
+
         (pops, unused_spans)
     }
 }