about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix1
-rw-r--r--tvix/eval/src/vm/mod.rs6
3 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp
new file mode 100644
index 000000000000..c508d5366f70
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp
@@ -0,0 +1 @@
+false
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix
new file mode 100644
index 000000000000..f4ef72a88b85
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix
@@ -0,0 +1 @@
+(builtins.tryEval (throw "fred" 5)).success
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 3d3b47be23e3..d57bd21e44c7 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -1056,6 +1056,12 @@ impl<'o> VM<'o> {
                 self.enqueue_generator("__functor call", span, |co| call_functor(co, val));
                 Ok(())
             }
+
+            val @ Value::Catchable(_) => {
+                self.stack.push(val);
+                Ok(())
+            }
+
             v => Err(ErrorKind::NotCallable(v.type_of())).with_span(&span, self),
         }
     }