fix(tvix/eval): fix testing catchables for inequality

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>
This commit is contained in:
Adam Joseph 2023-12-11 22:59:14 -08:00 committed by clbot
parent 1b2a1892cb
commit 663362f3df
3 changed files with 7 additions and 2 deletions

View file

@ -675,8 +675,13 @@ impl<'o> VM<'o> {
} }
OpCode::OpInvert => { OpCode::OpInvert => {
let v = self.stack_pop().as_bool().with_span(&frame, self)?; let v = self.stack_pop();
self.stack.push(Value::Bool(!v)); 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)) => { OpCode::OpList(Count(count)) => {