feat(vm): implement NAND on byte vectors of equal length

This commit is contained in:
Alain Zscheile 2022-09-25 15:55:06 +02:00
parent e65cfa9f91
commit 7ce7753bae

View file

@ -315,6 +315,12 @@ impl Process {
}
(Some(StackEntValue::Bytes(mut a)), Some(StackEntValue::Bytes(mut b))) => {
StackEntValue::Bytes(match mbo {
MathBinOp::NotAnd if a.len() == b.len() => {
a.iter_mut()
.zip(b.into_iter())
.for_each(|(x, y)| *x = !(*x & y));
a
}
MathBinOp::Add => {
a.append(&mut b);
a