fix(tvix/eval): fix branching on catchable defaults (b/343)
This commit adds Opcode::OpJumpIfCatchable, which can be inserted ahead of most VM operations which expect a boolean on the stack, in order to handle catchables in branching position properly. Other than remembering to patch the jump, no other changes should be required. This commit also fixes b/343 by emitting this new opcode when compiling if-then-else. There are probably other places where we need to do the same thing. Change-Id: I48de3010014c0bbeba15d34fc0d4800e0bb5a1ef Reviewed-on: https://cl.tvl.fyi/c/depot/+/10288 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
parent
e54eeda0ff
commit
9792920f8c
6 changed files with 20 additions and 0 deletions
|
|
@ -639,6 +639,7 @@ impl Value {
|
|||
gen_is!(is_number, Value::Integer(_) | Value::Float(_));
|
||||
gen_is!(is_bool, Value::Bool(_));
|
||||
gen_is!(is_attrs, Value::Attrs(_));
|
||||
gen_is!(is_catchable, Value::Catchable(_));
|
||||
|
||||
/// Compare `self` against other using (fallible) Nix ordering semantics.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue