diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-12T12·22-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T17·04+0000 |
commit | bb1e79e5d19a43beeebe8f858019131c57f99c65 (patch) | |
tree | 893ad0dc2ea8089afeb8aa3b01f306c6d3d613fd /tvix/eval/src/compiler/mod.rs | |
parent | bcc1ea85521ea99e03efb97bf397cd63ebc3398e (diff) |
fix(tvix/eval): propagate catchables through `&&` r/7192
Change-Id: I7bb5ac1ef47b41c47269e64cee0e90eb64c6fcce Reviewed-on: https://cl.tvl.fyi/c/depot/+/10322 Autosubmit: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/compiler/mod.rs')
-rw-r--r-- | tvix/eval/src/compiler/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 451fa44de7d1..f6d6ca7c06bc 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -546,6 +546,7 @@ impl Compiler<'_> { self.compile(slot, node.lhs().unwrap()); self.emit_force(&node.lhs().unwrap()); + let throw_idx = self.push_op(OpCode::OpJumpIfCatchable(JumpOffset(0)), node); // If this value is false, jump over the right-hand side - the // whole expression is false. let end_idx = self.push_op(OpCode::OpJumpIfFalse(JumpOffset(0)), node); @@ -559,6 +560,7 @@ impl Compiler<'_> { self.patch_jump(end_idx); self.push_op(OpCode::OpAssertBool, node); + self.patch_jump(throw_idx); } fn compile_or(&mut self, slot: LocalIdx, node: &ast::BinOp) { |