From 19878c5fef1f8bb1c051083a30616d4738d637e4 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 15 Aug 2022 00:38:30 +0300 Subject: [PATCH] feat(tvix/eval): implement OpPopWith Change-Id: I752d9428a73f893741746e9d5b79e8d8d570bb81 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6219 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: grfn --- tvix/eval/src/opcode.rs | 1 + tvix/eval/src/vm.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs index 4a4d47045..7d2de537d 100644 --- a/tvix/eval/src/opcode.rs +++ b/tvix/eval/src/opcode.rs @@ -54,6 +54,7 @@ pub enum OpCode { // `with`-handling OpPushWith(usize), + OpPopWith, // Lists OpList(usize), diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index 66126881a..8a6959114 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -282,6 +282,9 @@ impl VM { } OpCode::OpPushWith(idx) => self.with_stack.push(idx), + OpCode::OpPopWith => { + self.with_stack.pop(); + } } #[cfg(feature = "disassembler")]