about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-11T11·38+0300
committertazjin <tazjin@tvl.su>2022-08-25T16·00+0000
commitc7c7ab9bd4e105251ad56eb6c97157ee17354a9a (patch)
tree341d7952e41072574e95c619d462d9eeea1dafa8 /tvix/eval/src/vm.rs
parent4b920912b8ea5ad963b76359c27902f6ece2ceec (diff)
feat(tvix/compiler): implement `||` operator r/4486
Same dance as `&&` but logically inverted.

Change-Id: I213e200e3836527e9abe510f354ee7cd1f70d041
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6151
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/vm.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 4ea1b3b65c..ed040cf917 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -176,6 +176,12 @@ impl VM {
                     self.ip += offset;
                 }
 
+                OpCode::OpJumpIfTrue(offset) => {
+                    if self.peek(0).as_bool()? {
+                        self.ip += offset;
+                    }
+                }
+
                 OpCode::OpJumpIfFalse(offset) => {
                     if !self.peek(0).as_bool()? {
                         self.ip += offset;