~maelkum/viuavm

a128ed350dddf360db766817eb3651399d2d5913 — Marek Marecki 7 days ago a285a24
Fix operand fetches in arithmetic instructions

They were fetching values from 0th local register instead of using
default zero when they had void as input operand.
1 files changed, 2 insertions(+), 3 deletions(-)

M new/src/vm/ins.cpp
M new/src/vm/ins.cpp => new/src/vm/ins.cpp +2 -3
@@ 1319,9 1319,8 @@ auto execute_arithmetic_immediate_op(Op const op,
                                     Stack& stack,
                                     ip_type const ip) -> void
{
    auto& registers = stack.frames.back().registers;
    auto out        = get_proxy(registers, op.instruction.out, ip);
    auto in         = get_value(registers, op.instruction.in, ip);
    auto out        = get_proxy(stack, op.instruction.out, ip);
    auto in         = get_value(stack, op.instruction.in, ip);

    constexpr auto const signed_immediate =
        std::is_signed_v<typename Op::value_type>;