From ecbd7c6ca1e8331e7ef7f94bb4a196d78bcc895c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Sep 2022 03:09:18 +0300 Subject: fix(tvix/eval): ensure that root stack slot actually exists 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 Tested-by: BuildkiteCI --- tvix/eval/src/compiler/scope.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tvix/eval/src/compiler/scope.rs') diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs index d691a1ae7228..eb722a2c6972 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. /// -- cgit 1.4.1