about summary refs log tree commit diff
path: root/tvix/eval/src/vm
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-12-09T08·58-0800
committerclbot <clbot@tvl.fyi>2023-12-12T14·26+0000
commitad566999ca81e5d584acb5107e327a1aec9fdd5a (patch)
treed5e1e0d11fda7ef6e297d48e62df8978d20d924d /tvix/eval/src/vm
parentae28dc3ca64eb09d0ed792f0145576c17920ede5 (diff)
fix(tvix/eval): preserve catchables in nix_cmp_ordering(), fix b/338 r/7169
This commit fixes b/338 by properly propagating catchables through
comparison operations.

Change-Id: I6b0283a40f228ecf9a6398d24c060bdacb1077cf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10221
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix/eval/src/vm')
-rw-r--r--tvix/eval/src/vm/macros.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/tvix/eval/src/vm/macros.rs b/tvix/eval/src/vm/macros.rs
index 34e94bb5fa74..eb386df92fa3 100644
--- a/tvix/eval/src/vm/macros.rs
+++ b/tvix/eval/src/vm/macros.rs
@@ -44,7 +44,10 @@ macro_rules! cmp_op {
             let b = generators::request_force(&co, b).await;
             let span = generators::request_span(&co).await;
             let ordering = a.nix_cmp_ordering(b, co, span).await?;
-            Ok(Value::Bool(cmp_op!(@order $op ordering)))
+            match ordering {
+                Err(cek) => Ok(Value::Catchable(cek)),
+                Ok(ordering) => Ok(Value::Bool(cmp_op!(@order $op ordering))),
+            }
         }
 
         let gen_span = $frame.current_light_span();