about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/scope.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-03T00·09+0300
committertazjin <tazjin@tvl.su>2022-09-08T19·54+0000
commitecbd7c6ca1e8331e7ef7f94bb4a196d78bcc895c (patch)
tree4c6568b760235d381d7522769ba0ef178891c678 /tvix/eval/src/compiler/scope.rs
parentf8575fcd747eb3fe05413611eb97e26981bc9e1b (diff)
fix(tvix/eval): ensure that root stack slot actually exists r/4757
Instead of using a sentinel LocalIdx which potentially points to a
value in the locals stack that does not actually exist, set up an
initial uninitialised phantom value representing the result of the
root expression.

Change-Id: I82ea774daab83168020a3850bed57d35ab25c7df
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6424
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/compiler/scope.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index d691a1ae72..eb722a2c69 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -128,10 +128,6 @@ pub struct Upvalue {
 #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
 pub struct LocalIdx(usize);
 
-impl LocalIdx {
-    pub const ZERO: LocalIdx = LocalIdx(0);
-}
-
 /// Represents a scope known during compilation, which can be resolved
 /// directly to stack indices.
 ///