diff --git a/executor/src/main.cpp b/executor/src/main.cpp index f746c89..d3c901f 100644 --- a/executor/src/main.cpp +++ b/executor/src/main.cpp @@ -129,7 +129,7 @@ namespace { * @return 低字节非零 → 1,否则 0 */ int slot_bool(vm::Machine& m, uint32_t slot) { - return m.data()[static_cast(slot) * 8] ? 1 : 0; + return m.data()[m.slot_addr(slot)] ? 1 : 0; } /** @@ -139,7 +139,7 @@ namespace { * @param v 0/1(非零归一化为 1) */ void put_bool(vm::Machine& m, uint32_t slot, int v) { - m.data()[static_cast(slot) * 8] = v ? 1 : 0; + m.data()[m.slot_addr(slot)] = v ? 1 : 0; } /** @@ -301,7 +301,7 @@ int main(int argc, char** argv) { uint32_t guard = 0; while (machine.fault() == vm::Fault::None && !machine.ended()) { char buf[64]; - isa::disasm(machine.cur_instr(), buf, sizeof buf); + isa::disasm(machine.cur_instr_bytes(), machine.cur_instr_len(), buf, sizeof buf); const uint32_t pc = machine.pc(); const uint32_t fn = machine.fn_id(); if (!machine.step()) {