diff options
Diffstat (limited to 'tvix/eval/src/vm/mod.rs')
-rw-r--r-- | tvix/eval/src/vm/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs index 312d1b893520..3d3b47be23e3 100644 --- a/tvix/eval/src/vm/mod.rs +++ b/tvix/eval/src/vm/mod.rs @@ -675,8 +675,13 @@ impl<'o> VM<'o> { } OpCode::OpInvert => { - let v = self.stack_pop().as_bool().with_span(&frame, self)?; - self.stack.push(Value::Bool(!v)); + let v = self.stack_pop(); + if v.is_catchable() { + self.stack.push(v); + } else { + let v = v.as_bool().with_span(&frame, self)?; + self.stack.push(Value::Bool(!v)); + } } OpCode::OpList(Count(count)) => { |