feat(vm): concatenation of byte vectors

This commit is contained in:
Alain Zscheile 2022-09-23 20:58:13 +02:00
parent 993ce94fbd
commit 51438c5568

View file

@ -293,6 +293,26 @@ impl Process {
MathBinOp::Mul => u128::from(a).wrapping_mul(u128::from(b)),
}))
}
(Some(StackEntValue::Bytes(mut a)), Some(StackEntValue::Bytes(mut b))) => {
StackEntValue::Bytes(match mbo {
MathBinOp::Add => {
a.append(&mut b);
a
}
y => {
eprintln!(
"ERROR: BIF :math2:*({:?}) @ {} called with {:?}",
y,
previptr,
(
Some(StackEntValue::Bytes(a)),
Some(StackEntValue::Bytes(b)),
),
);
break;
}
})
}
x => {
eprintln!("ERROR: BIF :math2:* @ {} called with {:?}", previptr, x);
break;