diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-12T06·59-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T15·53+0000 |
commit | 663362f3df5cc62218db8b443a77b2d78240092a (patch) | |
tree | b579045bbc9aecb81d2d742b84af1741ea5b292d /tvix/eval/src | |
parent | 1b2a1892cbd13357c3987d74643d659587b2dc54 (diff) |
fix(tvix/eval): fix testing catchables for inequality r/7184
Fixes b/347. Change-Id: Icad0251884d4d8adcdf8d690b91385bf4896f9c8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10294 Tested-by: BuildkiteCI Autosubmit: Adam Joseph <adam@westernsemico.com> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp (renamed from tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp) | 0 | ||||
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix (renamed from tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix) | 0 | ||||
-rw-r--r-- | tvix/eval/src/vm/mod.rs | 9 |
3 files changed, 7 insertions, 2 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp index c508d5366f70..c508d5366f70 100644 --- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix index 93836bd8feeb..93836bd8feeb 100644 --- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix 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)) => { |